I want to enter the market with a stop limit, but also to say that if market goes 10 ticks away from my limit, then limit must be removed from the market. I try already using this code:
private double limitRemove = 10;
...
EnterLongStopLimit(1, High[5] + 1 * TickSize, High[5] + 1 * TickSize - limitRemove * TickSize);
Trying with
private IOrder myEntryOrder = null;
...
OnBarUpdate()
{
currentValue = High[5] + 1 * TickSize;
....
}
...
myEntryOrder = EnterLongLimit(0, true, 1, High[5] + 1 * TickSize, "Buy");
....
if (myEntryOrder != null && currentValue == (orderValue - limitRemove * TickSize))
{
CancelOrder(myEntryOrder);
}
It is compiling, but not working. Where can be the error?
Thanks for help!

Comment