I've just tried to create a strategy that places after the bar close two orders. Unfortunately it does not work. It just places 1 order and that's it!
Thank's for your help.
Regards,
Here is the code:
Namespace NinjaTrader.NinjaScript.Strategies
{
public class Short : Strategy
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Place 3 Limit Orders after Bar Close";
Name = "Short";
Calculate = Calculate.OnBarClose;
EntriesPerDirection = 100;
EntryHandling = EntryHandling.UniqueEntries;
IsExitOnSessionCloseStrategy = true;
ExitOnSessionCloseSeconds = 30;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
OrderFillResolution = OrderFillResolution.Standard;
Slippage = 0;
StartBehavior = StartBehavior.ImmediatelySubmit;
TimeInForce = TimeInForce.Gtc;
TraceOrders = true;
RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 0;
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = true;
}
else if (State == State.Configure)
{
}
}
protected override void OnBarUpdate()
{
EnterShortLimit(Convert.ToInt32(DefaultQuantity), (Close[0] + (10 * TickSize)) , "Limit20");
EnterShortLimit(Convert.ToInt32(DefaultQuantity), (Close[0] + (8 * TickSize)) , "Limit8");
}
}
}
Comment