Code: Select all
hLSMA1 := CreateIndicator(Currency, TimeFrame, 'LSMA', 'period1');
hLSMA1 := CreateIndicator(Currency, TimeFrame, 'LSMA', string(period1));
In the first case, I just put the variable name in as the parameter, but it said "wrong option value". In the second one, I tried to cast the integer as a string, but it gave me an access violation.
Sooo... does anyone know how to do this? All the examples show the parameters passed as numerical values, but I don't want to hardcode them in.. I want the user to be able to change the values, just like in the SMAStrategy that comes with FTPro..
Thanks.