• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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

    Comment


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

      https://ninjatrader.com/support/help...ries_class.htm

      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 saeed, Today, 12:32 PM
        3 responses
        32 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by motog4, Today, 11:42 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by derivtrader, Today, 11:20 AM
        5 responses
        27 views
        0 likes
        Last Post derivtrader  
        Started by TAJTrades, Today, 10:34 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by timcjpfx, Today, 10:20 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X