Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLongLimit on MBTrading

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

    EnterLongLimit on MBTrading

    I changed my strategy to have EnterLongLimit() instead of LongLimit() as I was displeased on the entry prices I was seeing. It looks like I am not using it correctly, or misunderstanding its use.

    if ((iOrderL1 == null || Historical) && iQuantity1 != 0)
    iOrderL1 = EnterLongLimit(0, true, iQuantity1, Close[0], sENTRY1L);

    Shouldnt the above wait until cancelled for a fill at the Close price from the trigger bar, ie the last bar that closed on BarsArray[0] ??

    First attempt today on MBTrading demo gives a fill at same slippage as a strategy running with code that is EnterLong()

    Screen attached of the limit order fill

    TJ
    Attached Files

    #2
    Hi TJ,

    if ((iOrderL1 == null || Historical) && iQuantity1 != 0)
    iOrderL1 = EnterLongLimit(0, true, iQuantity1, Close[0], sENTRY1L);

    Shouldnt the above wait until cancelled for a fill at the Close price from the trigger bar, ie the last bar that closed on BarsArray[0] ??
    Is this a backtest or a real time fill? If real time, what is your CalculateOnBarClose setting? What is the idea of the OR Historical part of this?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan!

      The screens shows the realtime ("First attempt today on MBTrading demo ") test.

      COBC=true.

      The OR Historical was part of the design from the certified Ninja consultant that helped with the strategy. The same strategy is used for backtesting and realtime. There is no "if (Historical)' type of code in the strategy so I am thinking this "OR" is a different way of doing the same idea.

      Thanks,
      TJ
      Last edited by Trader.Jon; 02-09-2011, 02:57 PM.

      Comment


        #4
        Close[0] should be the close price of the signal bar. Can you send in your log / trace files and we can see exactly how this order was submitted. Use Help > Mail to support feature with Attn:RyanM in subject. Let us know as well the time that these orders were placed.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Email sent

          Comment


            #6
            Thanks, Jon.

            The orders are all submitted at 1.3731

            2/9/2011 1:26:50 PM|1|32|Order='6afbc757dffc41f1bac491632b6e548f/Sim101' Name='e1L' New state=PendingSubmit Instrument='$EURUSD' Action=Buy Limit price=1.3731 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''

            Is this a multiseries script? Possibly getting the Close[0] value from another series? Did you reload historical data at all?

            I would monitor this and start printing the Close[0] value so you can verify it's what you expect. Let us know if this is something you can reproduce every time with the strategy.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Ryan,

              There was no reloading of historical data unless that happens when you load a strategy on a chart: and there were several bars on the chart prior to the signal being generated as it is set 'wait until flat' to enter a trade.

              I will monitor. I am concerned that you think that the Close[0] is from another time frame I am using ... can/should I use Closes[0][0] for the EnterLongLimit() instead ?? Would that resolve the MTF potential issue 100% ??

              Please clarify, for the Print of Close ...

              if (BarsInProgress == 0)
              Print("BA0 Bar closes"+Closes[0][0]); // and so on for each BarsArray?


              Thanks,
              Jon
              Last edited by Trader.Jon; 02-09-2011, 09:59 PM.

              Comment


                #8
                Close[0] not so good == run away very quickly

                Ryan,

                I used two different machines, with a different data source on each (MBTrading and Dukascopy), and modified the strategy to give me more trades, with same strategies on each machine. All testing in SIM from 3am today $EURUSD, default NT Range bars and also Better Renko. The strategy uses 3 Bars Array(0,1,2) for a mix of Range and Better Renko. The LongLimit entry is the same as earlier posted in this thread.

                Using just eyeballs, bottom line is that Close[0] as the limit entry price on my MTF strategy has slippage almost 100% of the time (up to 8 ticks!) based on the entry from the close of the trigger bar COBC=true && BarsArray==0. Use of Closes[0][0] as limit price in the same code had minimal if any slippage. This behaviour was seen on both NT Range bars and also the custom Better Renko bars.

                If you would like the logs and Print Output let me know asap, but I am guessing you can duplicate similar behaviour.

                I suggest changes in the help documentation if you find my observations to be consistent with yours, even if this is 'behavior as expected'.

                Regards,
                Jon
                Last edited by Trader.Jon; 02-10-2011, 09:46 AM.

                Comment


                  #9
                  Hi Jon,

                  Yes, multiple time frames could definitely contribute. If you don't exclude other BIP from the calculation then it will use the last updated Close. You may consider capturing the value you want in a variable within BIP 0

                  if (BarsInProgress == 0)
                  myLimitPrice = Close[0];

                  Additional information on this is available at the following link > True Event Driven OnBarUpdate() Method

                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    Thanks Ryan,

                    I think I will stay with the Closes[0][0] as the limit price unless you know of a drawback to its use in this scenario. I am trying to keep the code as clean as possible.

                    Regards,
                    Jon

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    633 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    364 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    105 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    567 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    568 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X