No Print output for earlier dates

Questions about MultiCharts and user contributed studies.
masber2000
Posts: 25
Joined: 15 Aug 2012
Has thanked: 2 times

No Print output for earlier dates

Postby masber2000 » 23 Jan 2023

Hello-

Today I ran the following print code:

Code: Select all

if date = 1220921 then Print("Test","********",Date,"****",time,"****",c);
It worked correctly- the data printed on the Output tab; however when I compiled the following

Code: Select all

if date = 1220920 then Print("Test","********",Date,"****",time,"****",c);
or any earlier date, there was no data printed to the output tab. Is this a quirk of the Print function (I have never seen this before)?

Thank you,

MB2K

User avatar
Polly MultiCharts
Posts: 54
Joined: 20 Jul 2022
Been thanked: 14 times

Re: No Print output for earlier dates

Postby Polly MultiCharts » 24 Jan 2023

Hello masber2000,

Please make sure the bar with this date is present on the chart.
Also please check the MaxBarsBack value in Format->Study->Properties tab->Max number of bars study will reference.

MaxBarsBack is the amount of bars that would be used for initial script calculation, to get the initial value of functions, variables. This amount of bars would be skipped, so you will see a first signal on maxbarsback+1 bar (for ex, may vary depending on the strategy).
For indicators the minimum MaxBarsBack is the largest look back (Length) required for calculation in this indicator.
Here is more info about it.

masber2000
Posts: 25
Joined: 15 Aug 2012
Has thanked: 2 times

Re: No Print output for earlier dates

Postby masber2000 » 24 Jan 2023

Thank you Polly, I'll check on the max bars back input. I notice that with strategies, MBB is a global input that needs to be manually set, whereas it can be individually set (and Auto-Detect) in the indicator properties. Why is that?

User avatar
Polly MultiCharts
Posts: 54
Joined: 20 Jul 2022
Been thanked: 14 times

Re: No Print output for earlier dates

Postby Polly MultiCharts » 25 Jan 2023

masber2000,

  • For signals the minimum MaxBarsBack is the largest MaxBarsBack required by all signals applied to the chart. For example, you have data1=1 min, data2=1 day. If an Average in your code references data2 with Length=10, then the required MaxBarsBack value is 10. 10 days of data will be skipped on both series. If your code does not reference additional data series then bars of data1 will be skipped only.
  • While for indicators the minimum MaxBarsBack is just the largest look back (Length) required for calculation in this indicator.
If your MaxBarsBack is too high (more than the amount of bars on your chart) then the study will be waiting for the required amount of bars. On the chart you can see a "Strategy calculating" message in such case or "Calculating" for an indicator.
Additional information can be found at this page.


Return to “MultiCharts”