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

More on Multidata Series Strategy

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

    More on Multidata Series Strategy

    ChelseaB and Jim have been helping me with this issue. Jim's last suggestion about storing data in an array versus a Series<double> variable has resolved some of my problems. About 1/2 of the array storage of data elements are correct and half are not.


    ChelseaB's suggestion of using AddDataSeries over AddRenko() seems to produce the values I am trying to obtain from adding multiple time frames to the same strategy. AddRenko was returning incorrect Closes[X] values, which AddDataSeries fixed. Here is my code of the State.Configure section:

    AddDataSeries(null, new BarsPeriod { BarsPeriodType = (BarsPeriodType)1995, Value = 8, Value2 = 3, BaseBarsPeriodValue = 50, MarketDataType = MarketDataType.Last});
    AddDataSeries(null, new BarsPeriod { BarsPeriodType = (BarsPeriodType)1995, Value = 16, Value2 = 3, BaseBarsPeriodValue = 50, MarketDataType = MarketDataType.Last});
    AddDataSeries(null, new BarsPeriod { BarsPeriodType = (BarsPeriodType)1995, Value = 32, Value2 = 3, BaseBarsPeriodValue = 50, MarketDataType = MarketDataType.Last});

    During my OnBarUpdate event, at the start of the event, I have a region of code that loads data into my arrays. This region has four large IF blocks that test against BarsInProgress to insure the correct arrays are populated using the correct close at the appropriate time. The test in the image is based when BarsInProgress = 1; the code for which is below:


    if (BarsInProgress == 1)
    {
    if (CurrentBars[1] < 1) return;
    tmpCurBar8 = CurrentBar;

    //prepair arrays (jelURBars 8) to hold a new value - increase array size by one
    jelIncreaseArrayDouble(ref arrayHammer8, 1);
    jelIncreaseArrayDouble(ref arrayTrend8, 1);
    jelIncreaseArrayDouble(ref arrayDirTH8, 1);
    jelIncreaseArrayDouble(ref arraySCTrigger8, 1);
    jelIncreaseArrayDouble(ref arraySCHedge8, 1);
    jelIncreaseArrayDouble(ref arraySCSignal8, 1);
    jelIncreaseArrayDouble(ref arrayDirSC8, 1);
    jelIncreaseArrayDouble(ref arrayZZLow8, 1);
    jelIncreaseArrayDouble(ref arrayZZHigh8, 1);
    jelIncreaseArrayDouble(ref arrayLRI8, 1);

    jelIncreaseArrayDouble(ref arrayTHPower8, 1);
    jelIncreaseArrayDouble(ref arraySCPower8, 1);

    //obtain last highest and lowest piviots
    double tmpPHigh = 0;
    double tmpPLow = 0;

    jelZigZag(ref tmpPHigh, ref tmpPLow, Closes[1]);

    arrayZZLow8[arrayZZLow8.Length - 1] = tmpPLow;
    arrayZZHigh8[arrayZZHigh8.Length - 1] = tmpPHigh;

    //obtain Trend and Hammer
    double tmpTrend = 0;
    double tmpHammer = 0;
    double tmpTHDir = 0;

    jelTHExt(ref tmpTrend, ref tmpHammer, Closes[1], CurrentBars[1]);

    arrayHammer8[arrayHammer8.Length - 1] = tmpHammer;
    arrayTrend8[arrayTrend8.Length - 1] = tmpTrend;

    tmpTHDir = jelTHDirection(arrayTrend8);
    arrayTHPower8[arrayTHPower8.Length - 1] = tmpTHDir;

    if (tmpTHDir < 0) arrayDirTH8[arrayDirTH8.Length - 1] = -1;
    if (tmpTHDir > 0) arrayDirTH8[arrayDirTH8.Length - 1] = 1;


    //obtain SC
    double tmpSCHedge = 0;
    double tmpSCTrigger = 0;
    double tmpSCSignal = 0;
    double tmpSCDir = 0;

    jelSCExt(ref tmpSCHedge, ref tmpSCTrigger, ref tmpSCSignal, Closes[1], CurrentBars[1]);


    Print(String.Format("T8: {0} | tmpSCHedge: {1} | tmpSCTrigger {2}",
    Time[0], tmpSCHedge, tmpSCTrigger));


    arraySCHedge8[arraySCHedge8.Length - 1] = tmpSCHedge;
    arraySCTrigger8[arraySCTrigger8.Length - 1] = tmpSCTrigger;
    arraySCSignal8[arraySCSignal8.Length - 1] = tmpSCSignal;

    tmpSCDir = jelSCDirection(tmpSCHedge, tmpSCTrigger);
    arraySCPower8[arraySCPower8.Length - 1] = tmpSCDir;

    if (tmpSCDir < 0) arrayDirSC8[arrayDirSC8.Length - 1] = -1;
    if (tmpSCDir > 0) arrayDirSC8[arrayDirSC8.Length - 1] = -1;

    //obtain linear regression intercept.
    double tmpLRI = 0;
    tmpLRI = LinRegIntercept(Closes[1], lriPeriod)[0];
    arrayLRI8[arrayLRI8.Length - 1] = tmpLRI;

    }
    The code in blue above is correctly obtaining and calculating values and storing them in the arrays without an issue. However, the code in red is producing erroneous values. In order to determine of the bad values were being altered after stored in an array, I created the green print statement above to test the values before applying them to the array. The values in the green print statement are also wrong, but match the values held in the array... so, this means that the data isn't being altered once applied to the array.

    After the data load region is complete, I have created a test block of code to perform unit testing with multiple print statements as follows:


    double curPower = jelGetPower();


    //if (BarsInProgress != 0) return;
    if (BarsInProgress != 1) return;
    //if (BarsInProgress != 2) return;
    //if (BarsInProgress != 3) return;


    Print("==========================================S TART===================================");

    Print(String.Format("04: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",
    Time[0], BarsInProgress, CurrentBar, arrayHammer4[arrayHammer4.Length - 1], arrayTrend4[arrayTrend4.Length - 1], arraySCHedge4[arraySCHedge4.Length - 1], arraySCTrigger4[arraySCTrigger4.Length -1], curPower, arrayDirTH4[arrayDirTH4.Length - 1], arrayDirSC4[arrayDirSC4.Length - 1], arrayZZLow4[arrayZZLow4.Length -1], arrayZZHigh4[arrayZZHigh4.Length - 1], arrayLRI4[arrayLRI4.Length - 1]));

    Print(String.Format("08: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",
    Time[0], BarsInProgress, CurrentBar, arrayHammer8[arrayHammer8.Length - 1], arrayTrend8[arrayTrend8.Length - 1], arraySCHedge8[arraySCHedge8.Length - 1], arraySCTrigger8[arraySCTrigger8.Length -1], curPower, arrayDirTH8[arrayDirTH8.Length - 1], arrayDirSC8[arrayDirSC8.Length - 1] , arrayZZLow8[arrayZZLow8.Length -1], arrayZZHigh8[arrayZZHigh8.Length - 1], arrayLRI4[arrayLRI8.Length - 1]));

    Print(String.Format("16: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",
    Time[0], BarsInProgress, CurrentBar, arrayHammer16[arrayHammer16.Length - 1], arrayTrend16[arrayTrend16.Length - 1], arraySCHedge16[arraySCHedge16.Length - 1], arraySCTrigger16[arraySCTrigger16.Length -1], curPower, arrayDirTH16[arrayDirTH16.Length - 1], arrayDirSC16[arrayDirSC16.Length - 1] , arrayZZLow16[arrayZZLow16.Length -1], arrayZZHigh16[arrayZZHigh16.Length - 1], arrayLRI16[arrayLRI16.Length - 1]));

    Print(String.Format("32: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",
    Time[0], BarsInProgress, CurrentBar, arrayHammer32[arrayHammer32.Length - 1], arrayTrend32[arrayTrend32.Length - 1], arraySCHedge32[arraySCHedge32.Length - 1], arraySCTrigger32[arraySCTrigger32.Length -1], curPower, arrayDirTH32[arrayDirTH32.Length - 1], arrayDirSC32[arrayDirSC32.Length - 1] , arrayZZLow32[arrayZZLow32.Length -1], arrayZZHigh32[arrayZZHigh32.Length - 1], arrayLRI32[arrayLRI32.Length - 1]));

    Print(" ");
    Print("-----------------------------------PREVIOUS---------------------------------------");

    if (CurrentBars[3] > 2)
    {
    Print(String.Format("04: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",
    Time[0], BarsInProgress, CurrentBar, arrayHammer4[arrayHammer4.Length - 2], arrayTrend4[arrayTrend4.Length - 2], arraySCHedge4[arraySCHedge4.Length - 2], arraySCTrigger4[arraySCTrigger4.Length - 2], curPower, arrayDirTH4[arrayDirTH4.Length - 2], arrayDirSC4[arrayDirSC4.Length - 2], arrayZZLow4[arrayZZLow4.Length - 2], arrayZZHigh4[arrayZZHigh4.Length - 2], arrayLRI4[arrayLRI4.Length - 2]));

    Print(String.Format("08: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",
    Time[0], BarsInProgress, CurrentBar, arrayHammer8[arrayHammer8.Length - 2], arrayTrend8[arrayTrend8.Length - 2], arraySCHedge8[arraySCHedge8.Length - 2], arraySCTrigger8[arraySCTrigger8.Length - 2], curPower, arrayDirTH8[arrayDirTH8.Length - 2], arrayDirSC8[arrayDirSC8.Length - 2] , arrayZZLow8[arrayZZLow8.Length - 2], arrayZZHigh8[arrayZZHigh8.Length - 2], arrayLRI4[arrayLRI8.Length - 2]));

    Print(String.Format("16: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",
    Time[0], BarsInProgress, CurrentBar, arrayHammer16[arrayHammer16.Length - 1], arrayTrend16[arrayTrend16.Length - 2], arraySCHedge16[arraySCHedge16.Length - 2], arraySCTrigger16[arraySCTrigger16.Length - 2], curPower, arrayDirTH16[arrayDirTH16.Length - 2], arrayDirSC16[arrayDirSC16.Length - 2] , arrayZZLow16[arrayZZLow16.Length - 2], arrayZZHigh16[arrayZZHigh16.Length - 2], arrayLRI16[arrayLRI16.Length - 2]));

    Print(String.Format("32: {0} | BarsInProgress: {1} | CurrentBar: {2} | Hammer: {3} | Trend: {4} | Hedge: {5} | Trigger: {6} | Power: {7} | THDir: {8} | SCDir: {9} | zzLow: {10} | zzHigh: {11} | LRI: {12}",
    Time[0], BarsInProgress, CurrentBar, arrayHammer32[arrayHammer32.Length - 2], arrayTrend32[arrayTrend32.Length - 2], arraySCHedge32[arraySCHedge32.Length - 2], arraySCTrigger32[arraySCTrigger32.Length - 2], curPower, arrayDirTH32[arrayDirTH32.Length - 2], arrayDirSC32[arrayDirSC32.Length - 2] , arrayZZLow32[arrayZZLow32.Length - 2], arrayZZHigh32[arrayZZHigh32.Length - 2], arrayLRI32[arrayLRI32.Length - 2]));
    }


    Print(" ");
    I am using the statement in purple above to only print the Print statements when BarsInProgress = 1 to filter each dataseries one at a time to test values. Regardless of the filter, the red section of code for each respective BarsInProgress = X IF blocks still produces incorrect values. The code for the function below is the same code that is producing the values in the databox (Hedge and Trigger) on the right of the image. These values should match and don't.

    private void jelSCExt(ref double eHedge, ref double eTrigger, ref double eSignal, ISeries<double> xClose, int curBar)
    {
    ….
    }
    I am also using a 9 period Linear Regression Intercept that is using an native NT8 function to calculate its value (See code in red). These values are also incorrect. These functions are using the same Closes[1] object to pull in data into these functions as the code that is correctly returning values. Below is an image that is showing this issue. My custom function and NT8s internal LinearRegressionIntercept() function are both returning incorrect values and I don't understand why.


    Click image for larger version

Name:	issuex4.png
Views:	347
Size:	1.20 MB
ID:	1060154

    #2
    Hello MarthaClines,

    A member of our NinjaScript support will provide any insights we are able once we have a moment to review.

    We appreciate your patience.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello MarthaClines,

      To confirm, you are finding that the values being calculated are incorrect?

      Or are you stating that the values that were saved in the custom series are no longer the values in the custom series and these have changed?

      Do you have a reduced script that removes all other code other than saving the value and then printing it to demonstrate the behavior?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_ChelseaB View Post
        Hello MarthaClines,

        To confirm, you are finding that the values being calculated are incorrect?

        Or are you stating that the values that were saved in the custom series are no longer the values in the custom series and these have changed?

        Do you have a reduced script that removes all other code other than saving the value and then printing it to demonstrate the behavior?
        Sorry I am not very good at explaining this. Its very complicated and I been working on it now for months. I have run across many issues and various things have help to some degree. Below I will try and step through the history to show what's working and what's not
        1. [*=1]Incorrect Closes[X] Values: When I was working with you initially, I noticed that Closes[X] (where x = specific bars in progress) was returning the wrong close value. You were helping me with this. I was using a custom Renko Bar type and using AddRenko() to add the data series. At that time I wasn't sure if it was the whole price series of Closes[X], so I pulled the last value and tried storing it in a custom Series<double> one value at a time and test against the custom Series<double> and I was still having the same incorrect close values. I was trying to figure out why the values were different so I performed various tasks on the counts and values of Closes[X] and the custom Series<double>. My original line of thinking was that it was pulling closes from the parent data series and not the secondary or a mixture of the two, but things were not matching in values and record counts. You suggested that I use AddDaatSeries instead of AddRenko to pull in a secondary data series. When I did this, I was getting correct Close[X] values and it fixed this problem, but it created a new problem described in part two below. You can find out discussion at the following link:

        2. Values being altered in Series<double>: The last message in that link above in #1 created a new problem. While I started receiving correct values for Closes[x], the values that were calculated in the custom indicators and stored in a Series<double> variable were incorrect. When a bit of time passed from my last post on that thread, I created a new thread on that subject, which was picked up by Jim. Only the most recent value in the Series<double> was correct, any past values stored in Series<double> variables were being altered for both the primary series (BarsInProgress = 0) and all secondary series (BarsInProgress = 1). Jim made the suggestion that I store the values in arrays and not Series<double> variables. This worked for some, but not all of my calculations, which brings us to where I am now with step three below and this new message thread. You can find this discussion with Jim at the following link:

        3. Correct Closes[X] with unaltered arrays returning incorrect values only in certain circumstances: Unfortunately, I am unable to determine (define) what these circumstances are. This code performs multiple calculations, some native indicators to ninja trader and some custom. I receive correct calculations for both type and incorrect calculation for both times on a indicator by indicator basis. I will define each of these one at a time - more specifically below:

        3a: ZigZag (Native to NT8) - Works without issue: In my code on my original post to this thread, in the section highlighted in blue you will see the following function:

        jelZigZag(ref tmpPHigh, ref tmpPLow, Closes[1]);
        The code for this custom function is as follows:

        public void jelZigZag(ref double tmpHigh, ref double tmpLow, ISeries<double> xClose)
        {
        tmpHigh = ZigZag(xClose, DeviationType.Points, 0.5, true).ZigZagHigh[0];
        tmpLow = ZigZag(xClose, DeviationType.Points, 0.5, true).ZigZagLow[0];
        }

        As you can see in my original post on this thread, I am storing these tmp values into an array. In my print statements, these values are correct. I have no issues with this section of code.

        3b. TH Hammer and TH Trend (my custom indicator) - Works without issue: From the original post, in the blue code section, you will see the following function"

        jelTHExt(ref tmpTrend, ref tmpHammer, Closes[1], CurrentBars[1]);
        Because of restrictions, I cannot post the code to this custom function. The tmp values are correct when returned by this function and stored correctly and unaltered in an array.
        3c. SC (my custom indicator) - Dose not contain correct values: From the original post, this section of code is highlighted in red. I am using a custom function as follows:

        jelSCExt(ref tmpSCHedge, ref tmpSCTrigger, ref tmpSCSignal, Closes[1], CurrentBars[1]);
        I cant post the code to this custom function either. To determine if my values of tmp variables are being altered when stored in an array or if being returned wrong by the function, I created the print statement seen in green in the code of my original post. The values printed from the array matched the values printed from the tmp variables in the green section of code - meaning that my values in the array are not being altered. So this for sure confirms that I do not have the same issues that was caused by using Series<double> variables that Jim suggested I avoid. Closes[1] and CurrentBars[1] are the same series used in my function in 3B that is working without issue. The code for this custom function matches the clode used to calculate the indicator when applied independently to a single series chart with the respective bartype settings.
        3d. Linear Regression Intercept (
        Native
        to NT8) Dose
        not
        contain correct values:
        From the originil post, in the section of code highlight in red I am using the following function native to NT8 as follows:
        tmpLRI = LinRegIntercept(Closes[1], lriPeriod)[0];


        The value returned to tmpLRI is inclrrect. I am using the same Closes[1] that is being used in 3A (no errors), 3B(no errors), 3C(has problems).

        In summary, I have one native NT8 function working and one native NT8 function not working. I also have 1 custom function working and 1 custom function not working. All of them are using the same Closes[1] price series, which now has the correct values since I started using AddDataSeries over AddRenko(). This issue is repeating for each IF block that for eas respective BarsInProgress = 0, BarsInProgress = 1, BarsInProgress = 2, and BarsInProgress = 3.

        Comment


          #5
          Hello MarthaClines,

          I'd like to continue simplifying and clarifying with you.

          You have mentioned "SC (my custom indicator) - Dose not contain correct values"

          Is this the specific issue? An indicator is returning incorrect values?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_ChelseaB View Post
            Hello MarthaClines,

            I'd like to continue simplifying and clarifying with you.

            You have mentioned "SC (my custom indicator) - Dose not contain correct values"

            Is this the specific issue? An indicator is returning incorrect values?
            if I place the indicator on a regular chart, it works fine. When I use the code to calculate on an added dataseries it dose not. The Linear Regression Intercept function is working the same way. It works on a regular chart but not on one with an added data series. However: ZigZag that comes with NT8 and my THHammer is working on both. Yet, all four are using the same Closes[X] object. I have confirmed that the correct Close[x] values are going into bother SC anf the LinearRegressionIntercept function - its calculating incorrectly, even though its running the same code when applied to a chart independently, where it works fine.

            Comment


              #7
              Hello MarthaClines,

              Thank you for confirming the issue is with the values returned by the indicator.

              We can ignore all the other code in this script other than calling the indicator.

              Here is an example of using a secondary series in an indicator that is called by a strategy.
              Hi Ninjatrader support team, I encountered a problem when using EMA Indicator on a secound dataseries. The plotting gets stopped after a while: emaStop.png


              With the indicator in question, what is being used for the data? Is the Input(s) series being used or is the Open(s), High(s), Low(s), and Close(s) being used?
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_ChelseaB View Post
                Hello MarthaClines,

                Thank you for confirming the issue is with the values returned by the indicator.

                We can ignore all the other code in this script other than calling the indicator.

                Here is an example of using a secondary series in an indicator that is called by a strategy.
                https://ninjatrader.com/support/foru...96#post1059996

                With the indicator in question, what is being used for the data? Is the Input(s) series being used or is the Open(s), High(s), Low(s), and Close(s) being used?
                I am a little confused on what you want me to try. My indicator dosent have a built in test for BarsInProgress. Its just a regular indicator that you apply to a regular chart that would normally have only one data series. This is how I know the values returned in the multidata test are wrong because I am plotting that single indicator. I took that code and copy/paste it into a function to return the values of the three plots so I can assign them to an array in the multi data series strategy. Do you want me to rewrite my indicator to support a different data series and then all that one?

                I will rewrite a version of this indicator for each barsInProgress - which will be three versions, to try this approach and let you know how it goes. The indicator calculations are closes only.

                I will try and do the same with NT8's internal LinearRegessionIntercept as well.

                Comment


                  #9
                  Hello MarthaClines,

                  It depends on what is written in the indicator on why it would be returning what you feel are incorrect values.

                  I would expect a separate chart with that indicator using the same input data would produce the same results.

                  The example I have linked demonstrates how to use a secondary series with an indicator and still be able to call AddChartIndicator() with it.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_ChelseaB View Post
                    Hello MarthaClines,

                    It depends on what is written in the indicator on why it would be returning what you feel are incorrect values.

                    I would expect a separate chart with that indicator using the same input data would produce the same results.

                    The example I have linked demonstrates how to use a secondary series with an indicator and still be able to call AddChartIndicator() with it.
                    I still a little fuzzy on what your saying. I have an Indicator called SC, that I apply to a regular chart. It has three plots. I copy and pasted that indicator as a function in my strategy and assigned the three plots to arrays because Series<double> variables data was being modified past the most current record. I have made an attempt to convert this indicator like your example, but it has three values I need to pull, how do I obtain all three values?

                    The indicator by itself is plotting correctly. Its when it plots from a AddDataSeries it dose not. The code the calculates the values is exactly the same, but the results are different.

                    I am working on printing the indicator that works out output 2 and the strategy that doesn't to output one. I will compare each calculations one at time. So far, I cant get data pulled into my strategy rewriting the indicator with barsinprogress to support 3 data points.
                    Last edited by MarthaClines; 06-12-2019, 07:46 PM.

                    Comment


                      #11
                      Hello MarthaClines,

                      I'd like to clarify something.

                      You mention:

                      "Its when it plots from a AddDataSeries it dose not"

                      So, I think you are comparing the output in the output window to an instance of the indicator on another chart, is this correct?
                      (Because, you would not be able to get a plot on a chart with AddChartIndicator with the instance called from the strategy if you are supplying a secondary series to the input series. The workaround for this is the example I provided you)

                      Is the indicator printing or is the strategy printing?

                      (If the indicator is already doing the calculations, they already have the data in plot series and there is no need to duplicate that data. Instead, we just need to get to the bottom of why the data is different.)

                      Have you tested the example script I have provided a link to?
                      Does this have behavior similar to what you are wanting to achieve?
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_ChelseaB View Post
                        Hello MarthaClines,

                        I'd like to clarify something.

                        You mention:

                        "Its when it plots from a AddDataSeries it dose not"

                        So, I think you are comparing the output in the output window to an instance of the indicator on another chart, is this correct?
                        (Because, you would not be able to get a plot on a chart with AddChartIndicator with the instance called from the strategy if you are supplying a secondary series to the input series. The workaround for this is the example I provided you)

                        Is the indicator printing or is the strategy printing?

                        (If the indicator is already doing the calculations, they already have the data in plot series and there is no need to duplicate that data. Instead, we just need to get to the bottom of why the data is different.)

                        Have you tested the example script I have provided a link to?
                        Does this have behavior similar to what you Brazzers Youporn Xhamsterare wanting to achieve?
                        Hello MarthaClines,

                        A member of our NinjaScript support will provide any insights we are able once we have a moment to review.

                        We appreciate your patience.
                        Last edited by mopakarim; 06-19-2019, 01:21 PM.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by BarzTrading, Today, 07:25 AM
                        2 responses
                        21 views
                        1 like
                        Last Post BarzTrading  
                        Started by devatechnologies, 04-14-2024, 02:58 PM
                        3 responses
                        20 views
                        0 likes
                        Last Post NinjaTrader_BrandonH  
                        Started by tkaboris, Today, 08:01 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post tkaboris  
                        Started by EB Worx, 04-04-2023, 02:34 AM
                        7 responses
                        163 views
                        0 likes
                        Last Post VFI26
                        by VFI26
                         
                        Started by Mizzouman1, Today, 07:35 AM
                        1 response
                        10 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Working...
                        X