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

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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by geotrades1, Today, 10:02 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by ender_wiggum, Today, 09:50 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by rajendrasubedi2023, Today, 09:50 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by bmartz, Today, 09:30 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by geddyisodin, Today, 05:20 AM
        3 responses
        26 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X