Page 1 of 1

Code examples

PostPosted: Wed Jan 30, 2019 6:47 pm
by ZoranB
Hi everyone,
new here and trying to find the best source for the code samples. I browsed through the User Guide but can't find much samples... For example, I am trying to alter one of the strategies to limit execution based on the ADX value but not sure what syntax I should use...

After crating the ADX object based on the candle close stream, I am using the following line of the code to read ADX value but I do not think it is obtaining the same value as ADX with the same parameter I see on my screen.
ADXValue = iADX.DATA:first();

any direction and help is appreciated....

Thanks,
Zoran

Re: Code examples

PostPosted: Thu Jan 31, 2019 6:42 am
by Apprentice
Hi from Zagreb
ADXValue = iADX.DATA:first();

Will return first period when iADX can be accessed.
Index on first ADX value calculated.
You will need to use iADX.DATA[period] or iADX.DATA[ iADX.DATA:size()-1] to access current or last ADX value respectively...

Re: Code examples

PostPosted: Thu Jan 31, 2019 9:47 am
by ZoranB
Thanks a lot!
Any suggestion for a good syntax reference?
Regards from Toronto,
Zoran