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

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?

                When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot. NinjaTrader 8 With NinjaTrader 8 we introduced strategy plots which provide the ability
                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 Sparkyboy, Today, 10:57 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post Sparkyboy  
                        Started by TheMarlin801, 10-13-2020, 01:40 AM
                        21 responses
                        3,916 views
                        0 likes
                        Last Post Bidder
                        by Bidder
                         
                        Started by timmbbo, 07-05-2023, 10:21 PM
                        3 responses
                        152 views
                        0 likes
                        Last Post grayfrog  
                        Started by Lumbeezl, 01-11-2022, 06:50 PM
                        30 responses
                        809 views
                        1 like
                        Last Post grayfrog  
                        Started by xiinteractive, 04-09-2024, 08:08 AM
                        3 responses
                        11 views
                        0 likes
                        Last Post NinjaTrader_Erick  
                        Working...
                        X