Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bollinger Band Squeeze Indicator (BBS)

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

    #16
    Thanks Hunter for the suggestion, I have already looked at BigMikeTrading

    Comment


      #17
      Hi Bertrand,

      The method MIN(TEMA, 252)[0] is very probably that I am looking for instead of Math.Min(..) but I cannot compile the code

      double TEMA=((((Close[0]-EMA(13)[0])*0.6)+((Close[0]-EMA(23)[0])*0.3)+((Close[0]-EMA(55)[0])*0.1)));
      double CEMA=(((100-0)/(MAX(TEMA,252)[0]-(MIN(TEMA,252)[0])))*(TEMA-MIN(TEMA,252)[0]));

      Do you have any suggestion where the mistake is ? The program error indicate that I cannot convert from Double to DataSeries

      Comment


        #18
        Loukas, you have set TEMA as a double variable and then try to use it in the MAX and MIN functions, which require a data series. Please see this reference sample for a demonstration of how to use data series to store an intermediate calculation to use in methods that expect a data series.
        AustinNinjaTrader Customer Service

        Comment


          #19
          Thanks Austin, Could you give me any suggestion where is the mistake at the second dataseries

          TEMA.Set(((Close[0]-EMA(13)[0])*0.6)+((Close[0]-EMA(23)[0])*0.3)+((Close[0]-EMA(55)[0])*0.1));
          CEMA.Set(((100-0)/((MAX(TEMA,252)[0])-(MIN(TEMA,252)[0])))*(TEMA-(MIN(TEMA,252)[0])));

          Plot0.Set(CEMA[0]);

          The erro explanation is that I cannot apply "-" to dataseries and double.
          Shall I make other 2 dataseries for MAX and MIN ?

          Comment


            #20
            Loukas, the error is here: *(TEMA-(MIN.

            The TEMA you're referencing there is still a data series, and you're trying to multiply the data series by a value, which won't work.

            You can do this though:
            Code:
            CEMA.Set(((100-0)/((MAX(TEMA,252)[0])-(MIN(TEMA,252)[0])))*(TEMA[0]-(MIN(TEMA,252)[0])));
            Note the [0] after the TEMA, which pulls the most recent value from TEMA, which is also a double value.
            AustinNinjaTrader Customer Service

            Comment


              #21
              Great, Thanks Austin

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              649 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              370 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              576 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X