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

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:
    Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.NinjaTrader 7 is an award winning end to end online ...


    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 CortexZenUSA, Today, 12:53 AM
    0 responses
    1 view
    0 likes
    Last Post CortexZenUSA  
    Started by CortexZenUSA, Today, 12:46 AM
    0 responses
    1 view
    0 likes
    Last Post CortexZenUSA  
    Started by usazencortex, Today, 12:43 AM
    0 responses
    5 views
    0 likes
    Last Post usazencortex  
    Started by sidlercom80, 10-28-2023, 08:49 AM
    168 responses
    2,265 views
    0 likes
    Last Post sidlercom80  
    Started by Barry Milan, Yesterday, 10:35 PM
    3 responses
    12 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X