Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Predictive Bollinger Band: Passing in Custom Data Series

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

    Predictive Bollinger Band: Passing in Custom Data Series

    I am having trouble passing in a custom data series to the BollingerEMA function.

    I created a Data Series called High_Series that has closing values of the RangeBars for all values except currentBar where the value is the Max close of the Range Bar. I want to predict the BB Upper value on Range Bar close if closes at top of Range Bar.

    Data Series has below data and I can see it is as expected. in the 0 index position 53.58 is the MaxRangeBar Close value all other values match actual closes.
    index: value Close (actual)
    0:53.58 Close: 53.5
    1:53.44 Close: 53.44
    2:53.57 Close: 53.57
    3:53.52 Close: 53.52
    4:53.45 Close: 53.45
    5:53.56 Close: 53.56
    6:53.65 Close: 53.65
    7:53.49 Close: 53.49
    8:53.37 Close: 53.37
    9:53.26 Close: 53.26
    10:53.26 Close: 53.26
    11:53.41 Close: 53.41
    12:53.28 Close: 53.28

    PredictBBUp2val = Math.Round(BollingerEMA (High_Series,2,12).Upper[0],2);
    PredictBBUp2val = 59.8

    But the real BB value = 53.67
    BBUpperV = Math.Round(BollingerEMA (2,12).Upper[0],2);

    Obviously something is not right about the Series I am passing in as the same function with virtually the same data should yield a number closer to the same. How best can I go about debugging this issue? I don't understand why the predicted value is so wrong given the data I fed it.

    #2
    Hello EricC64,

    Thank you for writing in.

    Without the full code I'm unable to test on my end.

    I would suggest adding print statements to check whether your conditions are becoming true. I’ve provided a link to a youtube video which covers an example of using prints to understand behavior:


    I’ve provided a link covering debugging which you may find helpful.
    Debugging: http://ninjatrader.com/support/forum...ead.php?t=3418

    If you’d like to send a copy of the strategy you’re running, I can take a look and see if anything jumps out.

    To export a NinjaScript from NinjaTrader 7 do the following:
    From the Control Center window select File -> Utilities-> Export NinjaScript...
    Select the file in the left column then click “>”, then press export and name the file.
    Then attach that file you saved; under My Docs>NT8>Bin>Custom>Select the downloaded .zip file.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    153 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    306 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    244 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    345 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    176 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X