Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

EnterLong/Short Delays

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

    EnterLong/Short Delays

    Greetings of the Season
    I will appreciate if someone could explain the following and guide me to do it better

    When using a EnterLong() or EnterShort() subject to certain condition I expect the trading to take place instantly. But to my surprise after the occurrence the said condition actual trading take place after the second or third bar. Sometimes it goes to the fourth bar. Why is the delay. For a day trader every bar is eventful . If the actual trading is taking place after the second or third or fourth Bar the actual condition intended for would have changed drastically, and may end up in a disastrous situation. Can some advice me how to overcome this situation. This is happening even in the sample Macrossover Strategy. I have also attached the chart to explain. Brown Vertical line indicates the occurrence of the condition. And the Cyan color indicates the actual execution.

    Thank You

    Simple
    Attached Files

    #2
    Hello Simple,

    Thank you for your post.

    Is this from a backtest or from live conditions?

    If a live scenario, do you run CalculateOnBarOnClose true or false?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi:
      Thanks for your reply. This is from Back test .
      CalculateOnBarClose = true;

      awaiting for your next step of advice.
      Thanks
      Simple

      Comment


        #4
        Simple,

        When dealing with the backtest the CalculateOnBarClose will always be set to true.

        This means that each bar is processed for OnBarUpdate() once. If an order is submitted and it gets filled it will be on the next bar and the execution will show. If the order is not filled immediately, it will then continue its logic for each bar update and process the working order.

        Let me know if I can be of further assistance.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Thanks a lot. Let me try this.
          I will keep you updated after my testing.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by agclub, 04-21-2024, 08:57 PM
          5 responses
          32 views
          0 likes
          Last Post agclub
          by agclub
           
          Started by ESHunter, Today, 08:06 PM
          2 responses
          16 views
          0 likes
          Last Post ESHunter  
          Started by ETFVoyageur, 05-07-2024, 07:05 PM
          19 responses
          150 views
          0 likes
          Last Post ETFVoyageur  
          Started by ETFVoyageur, Yesterday, 10:13 PM
          3 responses
          26 views
          0 likes
          Last Post ETFVoyageur  
          Started by ETFVoyageur, Yesterday, 12:52 AM
          3 responses
          33 views
          0 likes
          Last Post ETFVoyageur  
          Working...
          X