Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do you execute a strategy in one shot?

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

    How do you execute a strategy in one shot?

    Question - Is there a way to analyze all bars and then execute your strategy in a 'single shot', rather then on a 'bar-by-bar' basis?

    #2
    Hello,

    Thank you for the question. I am unsure I understand the logic you are asking.

    NinjaTrader has several ways you can process data, for example you can go from historical to realtime on a bar to bar basis. You can skip historical and start processing on realtime data. You can skip historical and process in realtime data, and also at a later time reference historical bars. Everything would relate to a linear timeline though and would be processed on each tick or on each bar close.

    Can you provide more description on the type of analysis you are seeking? I could see if there is a way to accomplish that.

    I look forward to being of further assistance.

    Comment


      #3
      Hi Jesse! Thanks for responding.
      I think I need to work with the DataSeries class:



      I would like to consume all the datapoints in the chart and then parse the data for things like the Highest high, Lowest low, Volume, etc... and then make a trading decision based on the outcome of my algorithm. I was wondering if I could find some code showing how that might be put together. Anything ot get me started on the right track would be much appreciated.
      Thank You,
      Rob

      Comment


        #4
        Hello,

        Thank you for the question.

        You could certainly run a loop over all of the avaliable data to determine the highest or lowest points in the series. Depending if you needed to break for the session there may already be indciators that accomplish the tasks needed.
        For example the CurrentDayOHL indicator will get the High and Low of the current session. There is also a PriorDayOHLC indicator which does the same for the prior session. If you needed to lowest and highest bar of all time, you could do that as well looping through all of the data.

        NinjaTrader uses standard C# for its language, so a for loop would suffice. You can determine the amount of bars on the chart by using Count - 1. A simple loop may include:

        for(int i = 0; i< Count - 1; i++)


        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        577 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