Order='NT-00000/Replay101' Name='Short' State=Working Instrument='ES 06-09' Action=SellShort Limit price=944.25 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='14bc74ceed314544bcba8a89a9afba29' Gtd='12/1/2099 12:00:00 AM'
Order='NT-00000/Replay101' Name='Short' State=Filled Instrument='ES 06-09' Action=SellShort Limit price=944.25 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=1 Fill price=944.25 Token='14bc74ceed314544bcba8a89a9afba29' Gtd='12/1/2099 12:00:00 AM'
Order='NT-00003/Replay101' Name='Short' State=Working Instrument='ES 06-09' Action=SellShort Limit price=941 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='864e51fabf144f35aa368b4d695a5354' Gtd='12/1/2099 12:00:00 AM'
Order='NT-00003/Replay101' Name='Short' State=Working Instrument='ES 06-09' Action=SellShort Limit price=941 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='864e51fabf144f35aa368b4d695a5354' Gtd='12/1/2099 12:00:00 AM'
Order='NT-00003/Replay101' Name='Short' State=Filled Instrument='ES 06-09' Action=SellShort Limit price=941 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=1 Fill price=941 Token='864e51fabf144f35aa368b4d695a5354' Gtd='12/1/2099 12:00:00 AM'
Order='NT-00006/Replay101' Name='Short' State=Working Instrument='ES 06-09' Action=SellShort Limit price=941.75 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='1d848f0a5f394e4a9b955774d2d5e076' Gtd='12/1/2099 12:00:00 AM'
Order='NT-00006/Replay101' Name='Short' State=Filled Instrument='ES 06-09' Action=SellShort Limit price=941.75 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=1 Fill price=941.75 Token='1d848f0a5f394e4a9b955774d2d5e076' Gtd='12/1/2099 12:00:00 AM'
Order='NT-00009/Replay101' Name='Short' State=Working Instrument='ES 06-09' Action=SellShort Limit price=939 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='17f8b78fc6db4c34a4d90f2ddfc8007a' Gtd='12/1/2099 12:00:00 AM'
Order='NT-00009/Replay101' Name='Short' State=Filled Instrument='ES 06-09' Action=SellShort Limit price=939 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=1 Fill price=939 Token='17f8b78fc6db4c34a4d90f2ddfc8007a' Gtd='12/1/2099 12:00:00 AM'
Order='NT-00012/Replay101' Name='Short' State=Working Instrument='ES 06-09' Action=SellShort Limit price=938.75 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='51cc9f4bc34b4859ad9ca1796d016764' Gtd='12/1/2099 12:00:00 AM'
Order='NT-00012/Replay101' Name='Short' State=Working Instrument='ES 06-09' Action=SellShort Limit price=938.75 Stop price=0 Quantity=1 Strategy='LimitOrders' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='51cc9f4bc34b4859ad9ca1796d016764' Gtd='12/1/2099 12:00:00 AM'
This is the logic I am using... Orders Per Direction is only 1 for now....
{
// Condition set 1
if (High[0] > EMA(Period)[0]
&& entryOrder == null)
{
entryOrder = EnterLongLimit(0, true, DefaultQuantity, GetCurrentBid() + -2 * TickSize, "Long");
}
// Condition set 2
if (Low[0] < EMA(Period)[0]
&& entryOrder == null)
{
entryOrder = EnterShortLimit(0, true, DefaultQuantity, GetCurrentAsk() + 2 * TickSize, "Short");
}
if (entryOrder != null)
{
Print(entryOrder.ToString());
if (entryOrder.OrderState == OrderState.Working
&& entryOrder.Action == Action.Buy
&& GetCurrentBid() >= entryOrder.LimitPrice + 4 * TickSize)
{
CancelOrder(entryOrder);
entryOrder = null;
}
if (entryOrder.OrderState == OrderState.Working
&& entryOrder.Action == Action.SellShort
&& GetCurrentAsk() <= entryOrder.LimitPrice - 4 * TickSize)
{
CancelOrder(entryOrder);
entryOrder = null;
}
if (entryOrder.OrderState == OrderState.Filled
&& entryOrder.Action == Action.Buy)
{
SetProfitTarget("Long", CalculationMode.Ticks, 8);
SetStopLoss("Long", CalculationMode.Ticks, 6, false);
entryOrder = null;
}
if (entryOrder.OrderState == OrderState.Filled
&& entryOrder.Action == Action.SellShort)
{
SetProfitTarget("Short", CalculationMode.Ticks, 8);
SetStopLoss("Short", CalculationMode.Ticks, 6, false);
entryOrder = null;
}
}
}


Comment