Any way to beat this and get a real time data2 moving average within the signal code (without resorting to global variables)?
Thanks,
-pdq
Signal Code:
Code: Select all
{************************************************************
Name : $Test_MA_Calc_Issue_Signal
Last Modified Date : 06/11/2019
************************************************************}
variables:
MA (0, data2);
// inputs and variable initialization section
MA = round(XAverage(close, 20), 1) data2;
once ClearPrintLog;
print("MA[0]= ", MA[0]:6:1,
" MA[1]= ", MA[1]:6:1);
Code: Select all
{************************************************************
Name : $Test_MA_Calc_Issue_Indicator
Last Modified Date : 06/11/2019
************************************************************}
variables:
MA (0, data2);
// inputs and variable initialization section
MA = round(XAverage(close, 20), 1) data2;
once ClearPrintLog;
print("MA[0]= ", MA[0]:6:1,
" MA[1]= ", MA[1]:6:1);