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 Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            576 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            334 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            553 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X