Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Applying strategy to chart

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

    Applying strategy to chart

    Dear NT support,

    I’m working with a colleague on a strategy. We are at the live testing a strategy.

    I am having some problems with it. He is running it using IB’s feed into a SIM101 account. I am running it using E-signal’s live feed.

    I am having problems when applying the strategy to a Chat window. The strategy appears to be processing the 1 min bars correctly when applied in the strategy tab. However, it doesn’t appear to be working or processing the bars correctly when applied to the chart.

    I have checked that the chart has enough days included (I have now adjusted that to 50 – whereas the strategy only requires 32). Any other ideas of areas to check?

    Additional information: It adds a additional timeframe of 1440 mins (simulate a day’s trading).

    Thanks and regards,

    Dan

    #2
    Dan, are you testing on NT 65 or 7? On the charts in NT7 you would need to set 'enabled' to 'true' for it to start and process data.

    Any errors in your log tab as it does not seem to work from a chart?

    It showing as running then in the strategies if you'd loading it from the chart?

    Are you both using the same min bars required settings? (the strategy would start trading if all series fulfill this criterion).

    Comment


      #3
      Bertrand,

      Thanks for your reply.

      I am using 6.5 as NT 7 is still in beta.

      I am seeing no errors in any of the logs. I have also attached Visual Studio to NT and am not seeing an logic errors thrown.

      I have just been working with my colleague against the live market and the strategy has been taking positions with his IB account whereas it hasn’t with mine.

      I have made adjustments to the min bar required as I have had problems with this before. I have inserted these checks into the code, which I have used successfully with other strategies.



      Code:
        
      
      if (CurrentBar <= 35)
                          return;
      and


      in the primary timeframe

      Code:
      if (BarsArray[1].CurrentBar <= 35)
      return;
      Thanks and regards,


      Dan

      Comment


        #4
        Thanks Dan, have you tried simplifying to see where the issue might be? For example if you comment out the added daily frame logic, does it change the behavior then? If you add the daily and have the bars check for 35 bars, then you would not have sufficient data likely loaded with your stated amount in the first post, so I suspect this is the issue likely here.

        Comment


          #5
          Bertrand,

          Thanks very much for your reply.

          I have commented out large chunks of code, this doesn’t appear to help.

          I have tried to adding sufficient data (e.g. setting Min bars required to 40) this does not work either.

          Kind regards,

          Dan

          Comment


            #6
            Dan, thanks - hmm then I would add Prints to the various code sections to see what is called and what not, so you could then proceed from there. Is the strategy worked on your friends PC using your eSignal? This way we could exclude the connection then...if you like I could run this on my eSignal here as well and see if I can reproduce this behavior.

            Comment


              #7
              Bertrand,

              Thanks again for your reply.

              We might have to take you up on your offer to run it against a chart at your end.

              I have now got it running against the crosses what appears to be successfully within the strategy tab (after some modifications to the code). However, we can’t cannot getting it running when applied to a chart.

              Should I forward a copy of the code though to the support mailbox?

              Thanks and regards,

              Dan

              Comment


                #8
                Hi Dan,

                That would be great. If you send to [email protected], be sure to reference this thread:
                Support for the development of custom automated trading strategies using NinjaScript.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Ryan / Bertrand,

                  Thanks very much for your continued support.

                  Good news. I’ve managed to fix this. Though, it was a funny one. Our strategy requires about 30 days (1440) of min data. I had been setting the charts to bring in 40 days to be sure we had enough data on the chart. In work this weekend I’ve set the chart to 60 days and it started to work. I’m not really sure was is happening there; 40 days should have been sufficient.

                  Thanks and regards,

                  Dan

                  Comment


                    #10
                    Dan, great to hear - I could only explain this by your min bars required setting, as for 1440 mins a default setting of 20 would be essentially 20 days before the strategy would start processing, if you add your custom need of 30 to this, you end up with a min of 50 days needed.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    666 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    377 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    110 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    575 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    580 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X