Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BoolSeries

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

    BoolSeries

    I'm using a multi-time frame and BoolSeries and trying to build a strategy.

    Is there any way to say did the BoolSeries trigger within the last ten bars on a different timeframe?

    Example:

    5 minute chart upTrend became true on current bar, look back to see if upTrend became true within the last 10 bars on 15 minute chart.

    Thank you.

    #2
    Hello shawnkm,

    You would need to add the secondary instrument series to your script. Then sync the boolseries with this added secondary series so there is one slot for each secondary series bar in the boolseries.

    Below is a link to an example of this.
    http://ninjatrader.com/support/forum...ead.php?t=3572
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I understand adding the secondary instrument series. And I understand the sync with the boolseries.

      What I dont understand is the code needed to test for true within the last 10 bars... ie. not just 10 bars ago... but was it true for any of the last 10 bars.

      Can you please provide the code needed for this?

      Thank you.

      Comment


        #4
        Hello shawnkm,

        You would need to loop through the last 10 bars and test for a true.

        bool trueFound = false;
        for (i = 0; i < 10; i++)
        {
        if (MyBoolsSeries[i] == true)
        {
        trueFound = true;
        }
        }

        if (trueFound)
        {
        Print("MyBoolSeries contains a true value within the last 10 bars");
        }
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sjsj2732, Yesterday, 04:31 AM
        0 responses
        33 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        286 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        284 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        133 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        91 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X