Jump to content
Matt

The R target calculation in hotkey

Recommended Posts

Posted (edited)

Hello,

I saw in one of @peterB's posts on is Blog that it's possible to add lines with hotkeys in DAS. I would like to add target lines for my 1R and 2R target dynamically when I take a position.

I tried adding code to Kyle's Hotkey without success.

Can someone tell me what's wrong with this code?

If you have any suggestions for improvement, that would be great.

Thank you!

 

StopPrice=Price-0.01;
$STOP=Price-0.01;
DefShare=BP*0.97;
Price=Ask-Price+0.01;
SShare=600/Price;
Share=DefShare-SShare;
DefShare=DefShare+SShare;
SShare=Share;
Sshare=DefShare-SShare;
Share=0.5*SShare;
TogSShare;
ROUTE=LIMIT;
Price= Ask+0.05;
$PRICE = Ask;
TIF=DAY;
BUY=Send;DefShare=400;
TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Share TIF:DAY;

$TARGETR=$PRICE-$STOP;
$RISKONE=$PRICE+$TARGETR;
$RISKTWO=$PRICE+($TARGETR*2);
FocusWidow TRADEFIVEMINUTES;
DrawHorzLineWithPrice($RISKONE);
DrawHorzLineWithPrice($RISKTWO);

 

Edited by Matt

Share this post


Link to post
Share on other sites
Posted (edited)
$PRICE+($TARGETR*2);

this is not possible in DASTrader as it dooes not know the mathematical logics and brackets

you need to do

$PRICE+$TARGETR+$TARGETR

instead

see the log for the errors you get. there will be an error about route not being "LIMIT" etc.

overall you should switch to the new syntax and forget the old one as the calculations done in the old syntax are now useless and it will be easier for you to understand what is going on rather than studying why the switches between SShare and Share are there

Edited by peterB
  • Like 1

Share this post


Link to post
Share on other sites

Ok! Thz @peterB  It help a lot.

I did not find on the DAS website any documentation on the new syntax. Do you have anything?

I will use your blog for reference for now.

Share this post


Link to post
Share on other sites
Posted (edited)

I use the "BBT 3 month SIM" subscribtion. I try some of the hotkeys on your blog and this is not working. I will have to stay with the old syntax.

 

image.png.75610f35dca062eb72f48d7e65dac97d.png

Edited by Matt

Share this post


Link to post
Share on other sites

you can use the new syntax for orders but specifically this line drawing has been fixed in 5.7.9.3 only

Share this post


Link to post
Share on other sites

Hi PeterB , is there a way one can test to see if the current symbol is a stock or an option for example with the Advanced hotkeys?  where can one find some literature on the commands plz ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.