Hi Nanitek,

thanks a lot for sharing this code.
I would like to use it in function run() by call-by reference function call and also plot it from here.
But I fail miserably to declare the function.
The handing-over parameters from new function “Supertrend” should be “ST and color flag”.
In function run() I only receive the data by the call and I don’t know how the statement should like like, I always receive pointer errors.

function definition:
var Supertrend (vars ST, vars color)

call function in function run():
vars Super = series();
vars ST = series();
vars Color = series();
ST = series(Supertrend(Super[0]),Color());


Trading conditions (simplified):
if (priceClose() > ST)
enterLong();
else
enterShort();

Can you or somebody else help me as lite-C beginner?

Thanks again in advance.