PDA

View Full Version : Trail Stop


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.

AnotherTrader
06-28-2010, 05:26 AM
OK, I found previous forum entries to something similar, so am investigating these now ...


http://www.ninjatrader.com/support/forum/showthread.php?t=25510&highlight=cancel+trail+stop
(http://www.ninjatrader.com/support/forum/showthread.php?t=25510&highlight=cancel+trail+stop)


http://www.ninjatrader.com/support/forum/showthread.php?t=14701&highlight=iorder+trail+stop
(http://www.ninjatrader.com/support/forum/showthread.php?t=14701&highlight=iorder+trail+stop)

NinjaTrader_Bertrand
06-28-2010, 05:30 AM
AnotherTrader, for this case I would recommend you just work with the SetStopLoss and adjust it's price dynamically as needed - http://www.ninjatrader.com/support/forum/showthread.php?t=3222

AnotherTrader
06-28-2010, 05:33 AM
OK, will look at that reference now.

Thanks.