Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get bar values from indicator.

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

  • NinjaTrader_Jesse
    replied
    Hello Herrwolf1,

    Thank you for the reply.

    I am not certain what you are asking for help with here. Are you asking how to determine the time range based on your loop? You would likely need to use the Time timestamps and some logic to determine what BarsAgo to use based on what you described. Can you provide more detail on what you needed assistance with?

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

    Leave a comment:


  • Herrwolf1
    replied
    I'm trying to create a full proof PSAR cross over tool. One that works from a strategy with the current time frame and a different time frame. If the current time frame is set to 60 minutes and the added psar is set to 240 minutes I need to count backwards and compare the High/Low candle values to the a specific index of the 240 PSAR. For example: if the 240 PSAR index is set to [4] then the current 60 minute bar can be [13] through [16].

    // In this scenario _startIndex == 4.
    double _psarHigh = RoundToTickSize(_240psar[_startIndex]);
    double _psarLow = RoundToTickSize(_240psar[_startIndex - 1]);

    // Determine if a cross over exists.
    for (int _i = _startIndex; _i < _lookBack; _i++)
    {

    // On a 60 minute chart [_i] would need to be 13, 14, 15, or 16 to compare with the _240psar.
    // I need a way to convert the count indexes [_i] from the _240psar (an indicator tied to the 240 minute series) to the current time frame.
    double _low = Low[_i];
    double _high = High[_i];


    if (_low > _psarLow && _high < _psarHigh) return true;
    }

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello Herrwolf1,

    Can you provide more details on what use case you are trying to do here? Are you trying to access indicator values from outside of the current indicator in a Strategy or what specific use case is being used?

    If you are using another indicator or strategy to call the indicator you would need to add the 240 minute series so the indicator can process. Because of adding that series you would have the CurrentBar for that series also so you could get the current value of the series.

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

    Leave a comment:


  • Herrwolf1
    started a topic Get bar values from indicator.

    Get bar values from indicator.

    I have my chart set to 60 minutes.
    I've added 240 minute indicator.
    If I obtain a value from the indicator as _ind[1], that could be 4 bars ago from the chart or it could be the current bar. This presents a problem while looping through the bars and comparing the OCHL values to the indicator. Does the indicator contain the those bar values or is there an easy way get the correct current chart bar index aligned with the indicator?

    Thanks,

    Eric...

Latest Posts

Collapse

Topics Statistics Last Post
Started by mlarocco, Yesterday, 11:12 AM
1 response
33 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by futurenow, 12-06-2021, 05:49 PM
19 responses
1,013 views
0 likes
Last Post Redders
by Redders
 
Started by mathfrick2023, 05-08-2025, 12:51 PM
8 responses
129 views
0 likes
Last Post Yogaman
by Yogaman
 
Started by several, 04-22-2025, 05:21 AM
1 response
287 views
0 likes
Last Post Lukasxgtx  
Started by NTEducationTeam, 06-12-2025, 02:30 PM
0 responses
45 views
0 likes
Last Post NTEducationTeam  
Working...
X