Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiseries Problem

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

    Multiseries Problem

    I am trying to create a simple multi-series indicator, but I can't the following code to work. I read the manual and the example strategy, but I don't see why it isn't working. I thought it might be the symbol, but I have used every combination I can think of, e.g. EURUSD, $EURUSD, EUR.USD, $EUR.USD, EUR/USD, $EUR/USD. Even if I use "MSFT" as in the example, I am getting the same error. Thanks for any help.
    Attached Files

    #2
    Vegasfoster, you are doing nothing wrong. If you try that code in an strategy it will work. Simply put, NinjaTrader 6.5 does not support multi-series indicators. NT7 does.
    AustinNinjaTrader Customer Service

    Comment


      #3
      vegas,

      What Austin means, is it will compile without errors in a

      namespace NinjaTrader.Strategy
      {
      }

      Comment


        #4
        OIC, thanks.

        Comment


          #5
          Can the result be plotted in a separate frame from the price? If so, how? Thanks.

          Comment


            #6
            Yes, you can just set in Initialize():
            Code:
            Overlay = false;
            EDIT: Perhaps I pulled the trigger too quick on the reply. Overlay is the property that decides if the indicator should be plotted on top of the price or not.
            Last edited by NinjaTrader_Austin; 03-09-2010, 04:20 PM.
            AustinNinjaTrader Customer Service

            Comment


              #7
              Everyone seems to do it this way, but it says 'The name strategyplot does not exist in the current context' and won't compile. Not sure what is wrong.

              Initialize()
              {
              Add(
              "AUDUSD", PeriodType.Minute, timeFrame);
              Add(
              "GBPCHF", PeriodType.Minute, timeFrame);
              Add(
              "EURUSD", PeriodType.Minute, timeFrame);
              Add(
              "EURCHF", PeriodType.Minute, timeFrame);
              Add(
              "NZDJPY", PeriodType.Minute, timeFrame);
              Add(
              "CHFJPY", PeriodType.Minute, timeFrame);
              Add(
              "USDJPY", PeriodType.Minute, timeFrame);

              Add(StrategyPlot(0
              ));
              StrategyPlot(0
              ).PanelUI = 2;

              CalculateOnBarClose =
              false;
              }


              OnBarUpdate()
              {
              if (BarsInProgress == 0)

              {

              double Index1 = Closes[1][0] + Closes[2][0] + Closes[3][0] + Closes[4][0] + Closes[5][0] + Closes[6][0] + Closes[7][0];

              StrategyPlot(0
              ).Value.Set(Index1);

              }
              }

              Thank you
              Attached Files

              Comment


                #8
                Do you actually have the underlying indicators in your files, too to achieve this functionality?

                http://www.ninjatrader-support2.com/...ead.php?t=6651
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  I do now, yep it works, thank you.

                  Comment


                    #10
                    Spoke to quickly, it compiles, but nothing plots. I tried removing the timeFrame parameter and hard keying "5", I changed all the StrategyPlot(0) to StrategyPlot(1) in case the number correlated with the id in the strategy plot indicator?, I commented out the double statement and changed StrategyPlot(1).Value.Set(Index1); to StrategyPlot(1).Value.Set(Closes[1][0]) to simplify that part of it. At this point I'm out of ideas.
                    Attached Files

                    Comment


                      #11
                      So I just took the sample strategy and replaced your code with mine and it still doesn't work. The panel shows up but it is empty. Hmm?


                      protectedoverridevoid Initialize()
                      {
                      CalculateOnBarClose =
                      true;

                      Add("AUDUSD", PeriodType.Minute, 5);
                      Add(
                      "GBPCHF", PeriodType.Minute, 5);

                      Add(StrategyPlot(0));
                      Add(StrategyPlot(
                      1));

                      StrategyPlot(0).Plots[0].Pen.Color = Color.Blue;
                      StrategyPlot(
                      1).Plots[0].Pen.Color = Color.Red;

                      StrategyPlot(0).PanelUI = 3;
                      StrategyPlot(
                      1).PanelUI = 3;


                      protectedoverridevoid OnBarUpdate()
                      {
                      StrategyPlot(0).Value.Set(Closes[1][0]);
                      StrategyPlot(
                      1).Value.Set(Closes[2][0]);
                      }

                      Comment


                        #12
                        Ok, went back to what I tried earlier, currency symbols must have the "$" prefix - "$GBPUSD", not "GBPUSD".

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by kiffgj, Today, 04:23 AM
                        0 responses
                        9 views
                        0 likes
                        Last Post kiffgj
                        by kiffgj
                         
                        Started by Lando Calrissian, Today, 07:30 AM
                        1 response
                        4 views
                        0 likes
                        Last Post NinjaTrader_BrandonH  
                        Started by lismartin, Yesterday, 04:47 PM
                        1 response
                        15 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by facuevasm, Today, 07:28 AM
                        3 responses
                        13 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by ballston, Today, 06:32 AM
                        0 responses
                        8 views
                        0 likes
                        Last Post ballston  
                        Working...
                        X