AnotherTrader
06-28-2010, 04:58 AM
Hi,
I am using ...
SetTrailStop("My Entry", CalculationMode.Ticks, stoploss, true);
.. for my trail stop.
Once the trail stop reaches breakeven, I want to keep the stop there (i.e. at breakeven).
How do I "cancel" the trail stop once price is at least "stoploss" in front of my entry level, so that I can then enter a fixed stop price?
Something along the lines of the following doesn't seem to work as I'd hoped ...
stopOrder = SetTrailStop("My Entry", CalculationMode.Ticks, stoploss,true);
then use (for a long)...
if(Close[0] > Position.AvgPrice + stoploss/100)
{ CancelOrder(stopOrder);}
... but this doesn't seem to be accepted code.
I am using ...
SetTrailStop("My Entry", CalculationMode.Ticks, stoploss, true);
.. for my trail stop.
Once the trail stop reaches breakeven, I want to keep the stop there (i.e. at breakeven).
How do I "cancel" the trail stop once price is at least "stoploss" in front of my entry level, so that I can then enter a fixed stop price?
Something along the lines of the following doesn't seem to work as I'd hoped ...
stopOrder = SetTrailStop("My Entry", CalculationMode.Ticks, stoploss,true);
then use (for a long)...
if(Close[0] > Position.AvgPrice + stoploss/100)
{ CancelOrder(stopOrder);}
... but this doesn't seem to be accepted code.