Jump to content
dmiles

Do DAS scripts handle negative integers in mathematical functions?

Recommended Posts

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

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

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.