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

Any Time Frame code from the given set

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

    Any Time Frame code from the given set

    Hello

    I wish to have an indicator code for :

    Conditions:
    1.Time frame from 30 minutes to 35 minutes i.e 30,31,,32,33,34,35.
    2.Any of the above time frames may fulfill the condition.i.e any one of the time frames from 30,31,32,33,34,35.minutes.
    3.the basic condition to be fulfilled is:
    HIGH[0]>OPEN[0] && OPEN[0]>CLOSE[0] && CLOSE[0]>LOW[0]

    This indicator will be used by me in market analyzer for scanning the requisite instruments.

    Kindly advise.
    Thanks in advance.

    #2
    Hello profitabletrader306,

    Thanks for your post.

    While we do not provide coding services, if you would like this indicator created for you we can provide references to 3rd party coders that provide that service.

    If you would like to create this yourself, you would need to add each of the time frames (of 31- 35) you have specified and this is done through the AddDataSeries() method: https://ninjatrader.com/support/help...dataseries.htm Note: the 30 minute time frame would be created in the indicator column of the market analyzer and would be the primary data series (BarsArray[0]).

    To provide the signal needed in the Market analyzer, you would need to add a plot to the indicator code using AddPlot(): https://ninjatrader.com/support/help...8/?addplot.htm

    When your conditions are true, you would set the plot value to be a +1, otherwise you set it to 0 (zero). In the market analyzer you can then set your cell conditions to work based on the +1 or 0 input from the indicator which gets added through the Indicator column.

    In the OnBarUpdate() section of the indicator:
    You would need to ensure the each time frame has loaded a bar before trying to access it and this is done by checking the CurrentBars[] value where the index[] value relates to the added data series. Reference: https://ninjatrader.com/support/help...urrentbars.htm This is needed to prevent indexing errors when the indicator is loaded.

    You would want to only process the data when BarsInprogress is equal to 0 (the primary series).

    Next you would set the Plot value to be 0 (zero) so that the plot will always be zero unless your conditions (in any time frame) are true.

    Finally you would create the conditions to check. In a multi time frame script, instead of, for example, High you would uses Highs[][] where the first [] would be the barsArray and the second[] would be the bar to evaluate (looks like this will always be zero). we highly recommend reviewing the multi time frame link to best understand how bar data is referenced in this type script along with other considerations: https://ninjatrader.com/support/help...nstruments.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks a million.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      238 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      383 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      1 view
      0 likes
      Last Post oviejo
      by oviejo
       
      Started by pechtri, 06-22-2023, 02:31 AM
      10 responses
      125 views
      0 likes
      Last Post Leeroy_Jenkins  
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Working...
      X