I am using a private double as the variable for my trailing stop the default value being 20 ticks.
While trading 3 contracts, I am trying to adjust the value of my Trailer to 15 ticks after the first target, and 10 ticks after the second target.
See below:
/* if (Position.MarketPosition == MarketPosition.Flat)
{
stop = 20;
}
//Adjust the stop
if (Position.Quantity == 2 && Position.MarketPosition != MarketPosition.Flat)
{
stop = 15;
}
if (Position.Quantity == 1 && Position.MarketPosition != MarketPosition.Flat)
{
stop = 10;
}*/
I have tried this under OnOrderUpdate and OnPositionUpdate methods but it is not working for me.
Also tried OnBarUpdate but it won't work there either. By this I mean, it uses 20 ticks in all trades.
Q1. Is it really possible to change the value an active trailing stop this way just like in an ATM template ? I want to take advantage of the Set methods and be able to adjust this.
NB: I am aware of the use of LongStopLimit , ShortStop bla bla bla under OnOrderUpdate methods to emulate an ATM strategy but this negates the use of the Set methods.
Thanks,
Kiriru
Comment