Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.
Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.
By using this site, you agree to our Terms of Use.
Avoid Reentry in Easy Language
in Automated Trading
Posted
Hi Trading friends
How can I stop Tradestation from taking a new position directly when Stoploss/trailstop has been hit. I don´t wont to use crosses over function.
Thanks for your help.
Best regards
Magnus
inputs: FastMovAvg(12), SlowMovAvg(26), Stoploss (2), trailstop (2);
Vars: Mashort ( 0 ), Malong (0);
Mashort=Average(close, FastMovAvg);
Malong=Average(close, SlowMovAvg);
If Mashort > Malong then
buy next bar at market;
if MarketPosition <> 0 then begin
Setstopcontract;
SetStopLoss(Stoploss*Bigpointvalue);
Setdollartrailing(trailstop*Bigpointvalue);
End;