Printf list series is possible ?

Posted By: faustf

Printf list series is possible ? - 01/04/21 23:49

hi guys
i saw in manual the printf return always a simple variable , but is possible return a series like this ?
Code
function run()
{
   BarPeriod = 24 * 60; // 1 day
   asset("EUR/USD");
 vars PriceHL = series(priceHigh() - priceLow());

var CellO = SMA(PriceHL, 48) + StdDev(PriceHL, 48);

   printf("Result = %.f\n", CellO);
   plot("MedianPriceOpenClose2", CellO, NEW, RED);
}

i tested but return me always 0 but if i plot i saw the line line
thanks at all
Posted By: Petra

Re: Printf list series is possible ? - 01/05/21 15:13

Yes but better put the \n at the begin of the string, otherwise it gets printed behind the bar line.
Posted By: faustf

Re: Printf list series is possible ? - 01/06/21 11:34

but why print always 0 ? instead in plot chart draw line ?? (and see value )
Posted By: ozgur

Re: Printf list series is possible ? - 01/07/21 18:54

There are 3 mistakes, compare yours to below one.

Code
function run()
{
   set(PLOTNOW);
   LookBack = 48;
   BarPeriod = 24 * 60; // 1 day
   asset("EUR/USD");
   vars PriceHL = series(priceHigh() - priceLow());

   var CellO = SMA(PriceHL, 48) + StdDev(PriceHL, 48);

   printf("Result = %.4f\n", CellO);
	
   plot("Max15Chars", CellO, NEW, RED);
}
Posted By: faustf

Re: Printf list series is possible ? - 01/15/21 17:26

thanks i will test this week end , but thanks again for support
© 2024 lite-C Forums