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

Bollinger Multitimframe Strat not working

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

    Bollinger Multitimframe Strat not working

    Hi all, having trouble with a simple Bollinger strategy,
    the idea is to have it plotting on a secondary DAILY series, while the primary is a 60 minute chart, but i cant seem to get it to plot on daily, works well with other minute combinations like 480, 720 etc..
    the indicator will work on Daily fine if added manually, but wont from the strategy

    ive tried:

    if (CurrentBars[1] < period) return;
    if (CurrentBars[1] < period || CurrentBars[0] < period) return;


    with no luck, thanks for your help.


    KBTSysBoll.zip
    Last edited by kabott; 12-15-2015, 04:11 PM.

    #2
    Hello,
    Can you provide a simplifed set of scripts which reproduce this scenario?

    I did review the scripts that you did attach. Can you clarify why you made these as a strategy? I do not see as to why you made them into a strategy but are using the indicator namespace.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Hi Cody, mm i dont quite understand your question, i wanted to test a bollinger system, to trade price reversing inside the bands, so if price goes above the upper bollinger or below the lower bollinger the strategy should look for a reversal price pattern in the primary index which is of 60 mnt bars, ill probably try other combinations latter, like daily bollinger + 26 Renko or 480 minutes bollinger + 15m Heinkei Ashi etc, but i cant get the daily boll to plot correctly .

      So, my problem to be specific is that the KBT_Boll indicator works well if added directly, meaning open indicators window and trow it to the chart from there, if thats the case then it plots on daily, minute etc correctly independent from the default chart series.
      Now when applied the Strategy, which calls the KBT boll , Daily series will not work.
      if i use a 1440 minute period or any other minute variation works ok.

      Strategy in example below: 1440 minutes Bollinger(20, 2) on a 60 minute chart
      Works right.
      Click image for larger version

Name:	example 1.jpg
Views:	1
Size:	181.6 KB
ID:	877036

      Same Strategy : 1 Day Bollinger(20,2) on 60 minute chart
      Doesnt works right.
      Click image for larger version

Name:	example 2.jpg
Views:	1
Size:	170.3 KB
ID:	877037

      Indicator: 1 Day Bollinger (20,2 ) on 60 minute chart
      Works right.
      Click image for larger version

Name:	2015-12-16_220150.jpg
Views:	1
Size:	128.2 KB
ID:	877038
      Last edited by kabott; 12-16-2015, 07:08 PM.

      Comment


        #4
        Cody, that .zip contains both the strategy and the indicator, the indicator alone works fine, however wen called by the strategy, with a setting of 1 Day doesn't plot right, has shown in the images attached in my previous post. i just want to fix this...i wanna understand why that happen.. :/

        Comment


          #5
          Hello kabott,

          Thank you for your patience.

          Both file in the .zip are just two versions of the same code in an indicator. Can you supply the strategy you are using?

          Comment


            #6
            Hi Patrick, sure, dunno what went wrong there :P

            KBTSysBollReversalStrategy.zip

            Comment


              #7
              Hello kabott,

              Can you provide a screenshot of the settings used for the strategy and the Data Series menu?

              Is the strategy meant to be applied to the Daily chart? Or are you asking about adding in the Daily bar as a secondary series in the strategy's code?

              Comment


                #8
                Hi Patrick, sorry the late response, just came back from work, screen-shots are in my post #3, along with an explanation of the problem, the strategy is meant to be applied in a smaller timeframe with the billinger plotting on Daily bars as a secondary timeframe, the settings for the averages are indistinct, but the "Parameters: Timeframe Select" in the strategy should be Daily and 1
                as shown in the second image of post #3

                Thanks Patrick, hope to see your reply on Monday

                Comment


                  #9
                  Hello kabott,

                  Thank you for your response.

                  Right click in the chart would like to see the indicator working on > select Data Series > take a screenshot of the Data Series menu and attach to your response.

                  Comment


                    #10
                    Hi Patrick, here r the screenshots

                    Click image for larger version

Name:	2015-12-21_123219.jpg
Views:	1
Size:	187.2 KB
ID:	877070

                    Click image for larger version

Name:	2015-12-21_123325.jpg
Views:	1
Size:	188.0 KB
ID:	877071

                    Comment


                      #11
                      Kabott,

                      Open your strategy code, go to line 81 and change the line of code to read as follows:
                      Code:
                      _Boll = KBTSysBoll_MTFV2(mayorTimeframePeriods, numStdDev, period, pType);

                      Comment


                        #12
                        aaalright! thank you very much Patrick!! now works as it should!

                        One more thing tho, how can i prevent the strategy to start working until the Billinger has started plotting?



                        Click image for larger version

Name:	2015-12-21_141225.jpg
Views:	1
Size:	146.2 KB
ID:	877072

                        ive tried adding
                        if ( CurrentBars[1] < 20) return;

                        but the strategy just stops working at all.

                        Thanks again P!

                        Comment


                          #13
                          I had no issues adding that to the beginning of OnBarUpdate().

                          Have you added yours as is shown below:
                          Code:
                                  protected override void OnBarUpdate()
                                  {
                          			if(CurrentBar <= 20)
                          				return;

                          Comment


                            #14
                            Hey, i tried that but it makes no difference, since that would check for 20 bars on the primary price, i need to check for 20 bars (Bollinger period) on the secondary price (1 Day), from where the bollinger is calculated, otherwise the strategy begins trading before the Bollinger begins plotting. like shown in of post #12 image.

                            Comment


                              #15
                              In that case you would use the following:
                              Code:
                              if(CurrentBars[0] <= 20 || CurrentBars[1] <= 20)
                              return;

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ZenCortexHurry, Today, 01:04 PM
                              0 responses
                              0 views
                              0 likes
                              Last Post ZenCortexHurry  
                              Started by f.saeidi, Today, 12:14 PM
                              3 responses
                              9 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by Russ Moreland, Today, 12:54 PM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by philmg, Today, 12:55 PM
                              1 response
                              4 views
                              0 likes
                              Last Post NinjaTrader_ChristopherJ  
                              Started by TradeForge, 04-19-2024, 02:09 AM
                              2 responses
                              31 views
                              0 likes
                              Last Post TradeForge  
                              Working...
                              X