Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add Multi Time Frame to Indicator

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

    Add Multi Time Frame to Indicator


    For the script below:

    if ((MACD2.Diff[0] > 0)
    && (ParabolicSAR1[0] < Low[0])

    Assuming my default time frame is (renko based). I would like the ParabolicSAR calculation to be based on the 1min time frame. In other words, the MACD calculation will be based on my default time frame but the "ParabolicSAR 1[0]< [Low][0]" condition will be based on the "Low" of the 1min bar.

    Similarly, if I wanted to check if the last 1min candle closed above the OPEN on my script, how would I do that?
    Last edited by cryfgg; 11-22-2021, 02:13 AM.

    #2
    Hello cryfgg,

    Thanks for your post.

    You could add an additional 1-minute data series to the script using AddDataSeries() and calculate your ParabolicSAR values using that added series.

    This could be set up using the Strategy Builder and then you could click the 'View code' button to see the generated code.

    You would add an additional data series in the Additional Data screen of the Strategy Builder, then in the Conditions and Actions section your would create your conditions. When creating your condition using the ParabolicSAR, you would set the 'Input series' field to use the added data series and the Low price. See the attached images.

    You could also set up conditions in the Strategy Builder that check if the Close price of the added series is greater than the Open price of the added series. Then, click the 'View code' button to see the generated code. To check the Close price and Open price of the added series, you would set the Close/Open 'Series 1' field to use the added data series when setting up your conditions.

    See the help guide documentation below for more information.
    Additional Data Screen: https://ninjatrader.com/support/help...onalDataScreen
    Conditions: https://ninjatrader.com/support/help...on_builder.htm
    Actions: https://ninjatrader.com/support/help...t8/actions.htm
    Multi-Timeframe and Instruments: https://ninjatrader.com/support/help...nstruments.htm

    Let us know if we may assist further.
    Attached Files
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Originally posted by NinjaTrader_BrandonH View Post
      Hello cryfgg,

      Thanks for your post.

      You could add an additional 1-minute data series to the script using AddDataSeries() and calculate your ParabolicSAR values using that added series.

      This could be set up using the Strategy Builder and then you could click the 'View code' button to see the generated code.

      You would add an additional data series in the Additional Data screen of the Strategy Builder, then in the Conditions and Actions section your would create your conditions. When creating your condition using the ParabolicSAR, you would set the 'Input series' field to use the added data series and the Low price. See the attached images.

      You could also set up conditions in the Strategy Builder that check if the Close price of the added series is greater than the Open price of the added series. Then, click the 'View code' button to see the generated code. To check the Close price and Open price of the added series, you would set the Close/Open 'Series 1' field to use the added data series when setting up your conditions.

      See the help guide documentation below for more information.
      Additional Data Screen: https://ninjatrader.com/support/help...onalDataScreen
      Conditions: https://ninjatrader.com/support/help...on_builder.htm
      Actions: https://ninjatrader.com/support/help...t8/actions.htm
      Multi-Timeframe and Instruments: https://ninjatrader.com/support/help...nstruments.htm

      Let us know if we may assist further.

      Thanks Brandon, i was able to add the data series to my script based on your recommendation.

      However, can you show me how to add a non-time based dataseies, like a UNIRENKO dataseries?

      I would like to add a condition that checks whether the last Unirenko Bar [1] closed above the open.

      Thank
      s

      Comment


        #4
        Hello cryfgg,

        Thanks for your note.

        UniRenko would be considered a custom BarsType. Custom BarsTypes must be added by using the BarsPeriodType index casted to BarsPeriodType. This can be noted in the BarsType's source code or can be asked from the BarsType developer. When adding a data series for a custom BarType, the AddDataSeries overload using a BarsPeriod must be used. This BarsPeriod must be made with the BarType's index casted to BarsPeriodType. This can be referenced in the custom BarType's source code, or the can be asked from the BarType's developer.

        Other BarsPeriod properties will also have to be supplied to configure the BarType. The BarsPeriod documentation page can be referenced for how NinjaTrader uses these properties. Their usage likely will vary for the custom BarType, so referencing that source code or consulting the developer is advised.

        See the AddCustomBarsTypeUniRenko example script located in post #6 in the forum thread linked below.



        Also, see the help guide documentation below.
        BarsPeriod - https://ninjatrader.com/support/help...barsperiod.htm
        AddDataSeries - https://ninjatrader.com/support/help...dataseries.htm

        And, see this forum thread for more information: https://ninjatrader.com/support/foru...r-an-indicator

        Let us know if we may assist further.

        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        581 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        338 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X