Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is This Possible?

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

    #16
    If it does not exit that is likely due to exit conditions never being met. You would need to debug the strategy. Here is some helpful information on debugging.


    RayNinjaTrader Customer Service

    Comment


      #17
      Hi Ray/Josh

      Thanks for your help, but I am still having some issues with this strategy. I am using the one as posted in Josh's reply and initially it seemed to work but that I cannot seem to get it to run correct now.
      The strategy does not open a position. It is as if it runs through the code first and the command simEntry=true under condition set 2 is executed first ...??
      If I remove that line, the strategy does open a position, but then of course it just loops into buy/sell continuously. If I put that ine back in under condition set 2, it never opens a position...

      Any ideas what would cause this behaviour?

      Comment


        #18
        Are you talking about real-time or backtesting?

        The check against Historical means it will only show up on backtests. Please use Print functions throughout the code to see what value simEntry is set to at various steps of your logic. This will help you determine why it is opening/not opening your position.
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by Josh View Post
          Are you talking about real-time or backtesting?
          I am trying it with the simuated data feed.

          Comment


            #20
            I'm guessing you start with a completely blank chart when you start up the Simulated Data Feed then.

            The problem is as stated in my previous post. The check against Historical will prevent anything from happening if all the bars on the chart were generated in real-time (sim feed is same as real-time).

            Alternatively you could probably try something like
            Code:
            if (CurrentBar == 1)
                 EnterLong(Quantity, "");
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            55 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            142 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            160 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            96 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            276 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X