Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Difference Plot vs Value

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

    #16
    yes plots before so I really did not need the prints, adding the lines of code for the time of the high bar etc and I do not have plots


    Print("PlotH1 FROM INDICATOR: " + PlotVWAPH1[0]);
    Print("High1 Time Indicator: " + Time[highestBarIndex]);

    Print("PlotL1 FROM INDICATOR: " + PlotVWAPL1[0]);
    Print("Low1 Time Indicator: " + Time[lowestBarIndex]);​

    and NO Prints

    NO log errors

    Comment


      #17
      this is the code from my other indicator for this Plot and it works as expected - that indicator has no Class private code for index or DateTime

      the indicator is using Secondary dataseries


      if (HighestBar(Highs[3], AnchorONELookBackPeriod) == 0)


      Print("HighestBar1 is equal to 0");

      Print("PlotH1x: " + PlotVWAPH1[0]);
      Print("PlotL1x: " + PlotVWAPL1[0]);

      Print("PlotH1: " + Values[4]);
      Print("PlotL1: " + Values[5]);

      int highestBarIndex3 = HighestBar(Highs[3], AnchorONELookBackPeriod);
      DateTime highestBarTime3 = Time[highestBarIndex3];

      double high3Price = High[highestBarIndex3];
      Print("High1 Time: " + Time[highestBarIndex3]);
      Print("High1 Price: " + high3Price);

      {
      startLogicH1 = true;
      }

      if ((startLogicH1 == true)
      && (Time[0] == highestBarTime3))

      {
      iCumVolumeH1 = Volumes[3][0];
      iCumTypicalVolumeH1 = Volumes[3][0] * ((Highs[3][0] + Lows[3][0] + Closes[3][0]) / 3);
      }

      else
      {
      iCumVolumeH1 = iCumVolumeH1 + Volumes[3][0];
      iCumTypicalVolumeH1 = iCumTypicalVolumeH1 + (Volumes[3][0] * ((Highs[3][0] + Lows[3][0] + Closes[3][0]) / 3));
      }

      Comment


        #18
        Hello DTSSTS,

        If the print is not appearing, either code is not being reached or a real-time error has occurred and disabled the script.

        I was not able to confirm, are there errors appearing on the Log tab?

        Add prints before each assignment and method call, Which print is the last to appear?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          No Prints NO LOG ERRORS

          since modifying the working script and adding the bar indexes and time etc there have been no plots or prints anymore

          I just need to go back to what I had that was working without the highest high I had prints that were as expected from the code but the values did not match

          See Post 1

          Comment


            #20
            Hello DTSSTS,

            Add a print to the top of OnBarUpdate() Print(Time[0]);. Do you see this print appearing?

            Chelsea B.NinjaTrader Customer Service

            Comment


              #21
              i had added prints just below the index and time lines of code

              Print("PlotH1 FROM INDICATOR: " + PlotVWAPH1[0]);
              Print("High1 Time Indicator: " + Time[highestBarIndex]);

              Print("PlotL1 FROM INDICATOR: " + PlotVWAPL1[0]);
              Print("Low1 Time Indicator: " + Time[lowestBarIndex]);​

              DO YOU WANT THIS above BarsInProgress or just below

              I think that were where they should be Cannot highestBarIndex befor it is declared

              Comment


                #22
                OK I see just Print(Time[0]);.

                Go it and Yes we have prints

                5/12/2023 3:58:00 PM
                5/12/2023 3:59:00 PM
                5/12/2023 4:00:00 PM
                5/12/2023 4:01:00 PM
                5/12/2023 4:02:00 PM
                5/12/2023 4:03:00 PM
                5/12/2023 4:04:00 PM
                5/12/2023 4:05:00 PM
                5/12/2023 4:06:00 PM
                5/12/2023 4:07:00 PM
                5/12/2023 4:08:00 PM
                5/12/2023 4:09:00 PM
                5/12/2023 4:10:00 PM
                5/12/2023 4:11:00 PM
                5/12/2023 4:12:00 PM
                5/12/2023 4:13:00 PM​

                you just want to know if I was telling the truth about NO Errors in the log

                Comment


                  #23
                  So code in Post 14 seems correct?

                  Comment


                    #24
                    Hello DTSSTS,

                    Understood.

                    Move the print down below the next lines of code. Do you still see the print output appearing?
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #25
                      if (BarsInProgress == 0 || CurrentBars[0] < 125)
                      return;

                      Print(Time[0]);​

                      We are loosing it here

                      Comment


                        #26


                        if (BarsInProgress == 0)

                        if (CurrentBars[0] < 125)
                        return;

                        Print(Time[0]);​

                        jfix that part

                        Comment


                          #27
                          Hello DTSSTS,

                          This would mean that BarsInProgress is not 0, or CurrentBars[0] is less than 125.

                          Print these with the time of the bar to understand the behavior.

                          Post the output saved to a text file with your next post.


                          Nesting these conditions so both have to be true at the same time to return, is not the solution. Meaning CurrentBars[0] could be less than 125 and the code will not return.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #28
                            i have a plot on the chart as expected now, but my prints of

                            Print("PlotH1 FROM INDICATOR: " + PlotVWAPH1[0]); << NO Value
                            Print("High1 Time Indicator: " + Time[highestBarIndex]);​
                            Attached Files

                            Comment


                              #29


                              I guess this
                              if (BarsInProgress == 0 || CurrentBars[0] < 125)
                              return;​

                              might be better with and because Current Bars have to be 120

                              if ((BarsInProgress == 0)
                              && (CurrentBars[0] < 125))
                              return;

                              We have prints this way

                              During the day I have tested both of these to begin condition set

                              if (HighestBar(High, 120) == 0) < --- from my prior code

                              if (​highestBarIndex == 0) << from your try this part

                              Both Compile , but when I change anything ( as simple as moving the PrintTime code line) while using the highestBarIndex I get about 30 lines of error in the lower panel of script window as needing to be resolved before compiling , but it still compiles

                              when I do the same with if (HighestBar(High, 120) == 0) NO lines of errors in the lower panel

                              https://gyazo.com/6c91c2254e8c04b04832326770c7dccf

                              I MOVE THE PRINT BELOW THE VALUES AREA

                              PlotVWAPH1[0] = (iCumTypicalVolumeH1 / iCumVolumeH1);
                              PlotVWAPL1[0] = (iCumTypicalVolumeL1 / iCumVolumeL1);


                              Print("PlotH1 Later PlotVWAPH1: " + PlotVWAPH1[0]);
                              Print("PlotL1 FROM PlotVWAPL1: " + PlotVWAPL1[0]);

                              Print("PlotH1 FROM Value: " + Values[0]);<< NO RESULT
                              Print("PlotL1 FROM Value: " + Values[1]);<< NO RESULT

                              PRINT RESULTS

                              5/12/2023 4:59:00 PM
                              High1 Time Indicator: 5/12/2023 3:56:00 PM
                              Low1 Time Indicator: 5/12/2023 3:02:00 PM
                              PlotH1 Later PlotVWAPH1: 13387.9493277213
                              PlotL1 FROM PlotVWAPL1: 13357.2370688871
                              PlotH1 FROM Value: NinjaTrader.NinjaScript.Series`1[System.Double]
                              PlotL1 FROM Value: NinjaTrader.NinjaScript.Series`1[System.Double]​

                              ​​

                              Comment


                                #30
                                Hello DTSSTS,

                                Values[0] and Values[1] are both entire series.

                                Were you meaning to print the most recent bar?
                                If so, you need the barsAgo index.

                                Values[0][0]
                                Values[1][0]
                                Chelsea B.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by NullPointStrategies, Today, 05:17 AM
                                0 responses
                                51 views
                                0 likes
                                Last Post NullPointStrategies  
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                128 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                69 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                42 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                46 views
                                0 likes
                                Last Post TheRealMorford  
                                Working...
                                X