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

So near yet so far .......Higher Timeframe

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

    So near yet so far .......Higher Timeframe

    On a 1 minute chart I want to plot the high and low of the last completed 30 minute bar.

    I have successfully plotted SMA/EMA of a higher timeframe using:

    Add(PeriodType.Minute,
    5); // Adds a 5 MINUTE Bars object
    ....

    HigherLongerEMA.Set(SMA(BarsArray[1],longerperiod)[0]);


    for example.

    However when I try to plot the 30 min High and Low, no matter what I try I cannot get anything to work.

    I even tried an SMA for 1 period for example adding High and got the 2many arguments error.

    Can someone please point out a simple fix.

    Help


    #2
    Originally posted by skiguy View Post
    On a 1 minute chart I want to plot the high and low of the last completed 30 minute bar.

    I have successfully plotted SMA/EMA of a higher timeframe using:

    Add(PeriodType.Minute,
    5); // Adds a 5 MINUTE Bars object
    ....

    HigherLongerEMA.Set(SMA(BarsArray[1],longerperiod)[0]);


    for example.

    However when I try to plot the 30 min High and Low, no matter what I try I cannot get anything to work.

    I even tried an SMA for 1 period for example adding High and got the 2many arguments error.

    Can someone please point out a simple fix.

    Help

    Just the same way. If you want to get the lowest low & highest high of the secondary series over the last 20 bars (this period is of the secondary series):

    double lowestLow = MIN(Lows[1], 20)[0];
    double highestHigh = MAX(Highs[1], 20)[0];
    Last edited by ninZa; 03-01-2015, 11:42 PM.
    ninZa
    NinjaTrader Ecosystem Vendor - ninZa.co

    Comment


      #3
      Hello skiguy,

      Thank you for your post.

      You could add a 30 minute bar series and just call Highs and Lows for the barsInProgress. If the 30 minute was the only added series you would use Highs[1][0] and Lows[1][0]. For information on multiple series in your code please visit the following link: http://www.ninjatrader.com/support/h...nstruments.htm

      Please let me know if I may be of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rocketman7, Today, 01:00 AM
      0 responses
      1 view
      0 likes
      Last Post rocketman7  
      Started by wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      27 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 02-22-2024, 01:11 AM
      5 responses
      32 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 04-23-2024, 09:53 PM
      2 responses
      74 views
      0 likes
      Last Post wzgy0920  
      Started by Kensonprib, 04-28-2021, 10:11 AM
      5 responses
      193 views
      0 likes
      Last Post Hasadafa  
      Working...
      X