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 andrewtrades, Today, 04:57 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      3 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      7 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X