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.

IkennaO

Script Does not set new Stop

Recommended Posts

IkennaO

Hi All

I'm having some issues with my DAS scripts. I have two scripts which given a current position and stop loss, sells/covers 50% of my position and sets a new stop loss. However there are times when the script will sell//]cover my position, but sometimes fail to set a new stop loss. This doesn't happen during replay mode, but will occasionally happen when I trade live using the simulated account.

Can someone tell me how to prevent this from happening? The scripts are detailed below. Thanks

 

 

Sell Percentage and move to Break Even

CXL ALLSYMB;ROUTE=LIMIT;Price=BID-0.05;Price=Round2;Share=Pos*.5;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos;TIF=GTC;SELL=SEND


Cover Percentage and move to Break Even

CXL ALLSYMB;ROUTE=LIMIT;Price=ASK+0.05;Price=Round2;Share=Pos*.5;TIF=DAY+;BUY=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos;TIF=GTC;BUY=SEND

 

 

Edited by IkennaO

Share this post


Link to post
Share on other sites
peterB

that is because your order was not filled quickly enough, you can solve it by adding wait(1000) or try the Triggerorder syntax after your Send; command
more on hotkeys

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.