Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy running on ES that sends orders to micro es

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    strategy running on ES that sends orders to micro es

    Hi im trying to get my strategy that executes on the ES to place orders on micro es at the exact same time.

    Im finding a bit of a delay between the time the ES order is submitted and the MES

    in my code example below the main data series is the MES and ES would be the second data series. . My main ES strategy uses on bar close true.and im trying to make sure we ignore the primary MES data series to avoid delays.

    Any ideas why their is a delay when placing orders on MES ? and what is the best way to go about getting exact order timing for both markets?

    thanks,



    protected override void OnBarUpdate()
    {
    if (BarsInProgress != 0) - this is the MES chart
    return;

    if (BarsInProgress == 1) This is the ES chart
    return;

    if (CurrentBars[0] < 1
    || CurrentBars[1] < 1
    || CurrentBars[2] < 1
    || CurrentBars[3] < 1
    )

    return;

    #2
    use ES as the primary BarsArray[0] - and submit orders to the secondary MES? BarsArray[1]

    protected override void OnStateChange()
    {

    ....... if (State == State.Configure)
    {
    AddDataSeries("MES 09-19", Data.BarsPeriodType.Minute, 1, Data.MarketDataType.Last);
    }
    protected override void OnBarUpdate()
    {

    .......
    //do primary techncials and submit to secondary instrument added onInit
    if(BarsInProgress==0)
    {
    if (CurrentBar < BarsRequiredToTrade)
    return;

    if (CrossAbove(smaFast, smaSlow, 1))
    EnterLong(1,1,"L-MES");
    else if (CrossBelow(smaFast, smaSlow, 1))
    EnterShort(1,1,"S-MES");

    return;
    }

    //do stuff here for secondary MES

    }
    MicroTrends
    NinjaTrader Ecosystem Vendor - micro-trends.co.uk

    Comment


      #3
      "Any ideas why their is a delay when placing orders on MES ? and what is the best way to go about getting exact order timing for both markets?"
      The other way might be to link 2 parallel strategies master slave - and push the signal through from ES to MES - you can backtest the ES or MES with that you can backtest and only write 1 strategy but use it in 2 modes - Master or Slave... master calls Long/Short on Slave for example...

      more advanced
      fastest way - You can always just use the account object and bypass loading bars for MES - for example just run your rule son the ES - but copy the trades to the MES in realtime - cant backtest that though... and you might need to take care of the strategy trade man- also via account object

      MicroTrends
      NinjaTrader Ecosystem Vendor - micro-trends.co.uk

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X