Jump to content

We have moved to Discord. Please click here to join us in the Trading Terminal Discord server.



These forums are read-only.

dmiles

Do DAS scripts handle negative integers in mathematical functions?

Recommended Posts

dmiles

My original question is the only reason I can think of as to why this script gives me a "script error, invalid price" message. Trying to make a simple hotkey script for Range order, short, where I can double click above my entry price, and generate a 2to1 range sell order. 

CXL ALLSYMB;ROUTE=STOP;StopType=Range;HighPrice=Price;LowPrice=AvgCost-Price*2+AvgCost+AveCost;Share=Pos;TIF=DAY+;BUY=Send;ROUTE=SMRTM

Say you have a $100 short entry, and you double click a stop price at $110.

Then, 100-110*2+100+100=80, which is what I'm looking for. 

So is it the fact that the math involves negative integers, or am I missing something else? I know this should be a simple script, but I have been unable to find one that works for a short entry.

Thanks! @Kyle29 

Edited by dmiles
Forgot to tag Kyle, the most important part!

Share this post


Link to post
Share on other sites
dmiles

Nevermind, I figured it out. If anyone needs a simple hotkey script for a range order for a short position that you can set the R to R for, just reply to this topic.

Share this post


Link to post
Share on other sites
RussWilliamL

what was your resolution to this problem?  (I'm struggling with short position range orders)

Share this post


Link to post
Share on other sites

[[Template core/front/global/mobileNavigation is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

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.