• 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

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 ralett, Today, 03:09 PM
      1 response
      2 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by martyn73, Today, 02:54 PM
      2 responses
      13 views
      0 likes
      Last Post martyn73  
      Started by Zigfried, Today, 01:59 PM
      4 responses
      12 views
      0 likes
      Last Post Zigfried  
      Started by giogio1, 11-10-2019, 11:21 PM
      2 responses
      30 views
      0 likes
      Last Post bltdavid  
      Started by w0lverine, Today, 12:39 PM
      4 responses
      9 views
      0 likes
      Last Post w0lverine  
      Working...
      X