15 Comments
User's avatar
hmx's avatar

for the static 1% risk script above, is it possible to have it use initial equity instead of current equity? what would be the syntax? thank you

Expand full comment
10xReturns's avatar

When using the 1% script above I continuously receive orders that try to exceed my buying power, so they wont execute. It seems the script doesn't check if the amount of shares proposed exceed buying power.

The below script works, but I cant figure out how to attach a range order to it that takes the spot I double clicked on the chart for the stop, and the 3:1 reward/risk. Any help would be appreciated.

DefShare=BP*0.97;

Share=DefShare*1*Price*0.01;

Price=Ask-Price+0.01;

SShare=Share/Price;

Share=DefShare-SShare;

DefShare=DefShare+SShare;

SShare=Share;

Sshare=DefShare-SShare;

Share=0.5*SShare;

TogSShare;

ROUTE=LIMIT;

Price= Ask+0;

TIF=DAY+;

BUY=Send;

Expand full comment
Peter Benci's avatar

yeah the bp check would require one more condition in the script. this one just expects that if you are risking 1% of your cash, the bp should not be a problem unless you have so tight stops that the position would be higher than the bp. pm me so we can discuss your specific case. the above script does not use das advanced hotkeys syntax

Expand full comment
Sam's avatar

Hi Peter,

Using the format laid out in Dashotkeys 4.

I tried to write the following script:

$MYTGTAVG=GetStudyVal("TGTAVG");

$MYDISTANCE=LAST-$MYTGTAVG;

While first one works,the second one gets string value LAST instead of subtracting last price - TGTAVG.Do you have any insight on it? Does LAST need to be defined too?

Expand full comment
Peter Benci's avatar

in part 8 it is explained as MYPRICE

Expand full comment
Sam's avatar

Thank you! It worked.Appreciate your help.

Expand full comment
Peter Benci's avatar

which one worked? :)

Expand full comment
Sam's avatar

Sorry I should have clarified,I defined MYPRICE study as per part 8 and used that in the calculation to get the value.That one worked :)

"LAST" dint give me desired result.

Expand full comment
Peter Benci's avatar

last is only working when you have the montage window focused. try to use "LAST" instead and if not you need to read the last from the chart with an indicator read as in the first case

Expand full comment
Peter Benci's avatar

you mean like trailing stop or exit on a condition?

Expand full comment
Ben's avatar

Yes, exit on a condition.

In this article, you explain how to read an indicator value but you say It's static so it can't be used for a conditional stop order (exit if break of vwap for instance).

Expand full comment
Peter Benci's avatar

it is covered partially in part 9. i will write an article on conditional exit soon

Expand full comment
Ben's avatar

Did you end up covering the topic of "dynamically changing stop orders" somewhere ?

Expand full comment
Peter Benci's avatar

existing orders not but we can do any buy/sell action on any condition

Expand full comment
User's avatar
Comment deleted
Oct 10
Comment deleted
Expand full comment
Peter Benci's avatar

i am not trading penny stocks so for those you might need to round to 3 decimals rather than the 2 in this example. otherwise be more specific as i have no idea what you are trying to do

Expand full comment