Hi all.. I'm new here so please bear with me.
I'm relatively new in Java but a bit experienced in Thinkscript and Pinescript.
I'm stuck and very confused at the moment. Been trying to find any solution for days but unsuccessful so I seek help.
It just a short code, please let me know if it needs more.
It's a study and when I do this:
Double lossema=series.ema(index,atrPeriod,Values.TRUERANGE);
all good, lines visible on the chart.
But when I do this:
Double lossema=1.5*series.ema(index,atrPeriod,Values.TRUERANGE);
Suddenly I have this error:
"java.lang.NullPointerException: Cannot invoke "java.lang. Double.doubleValue()" because "<local33>" is null at study_examples.ATR_TrailingStop.calculate(ATR_TrailingStop.java:129)"
It should be very simple and yet I can't solve it. Anyone can tell me what's wrong?
Thank you
I'm relatively new in Java but a bit experienced in Thinkscript and Pinescript.
I'm stuck and very confused at the moment. Been trying to find any solution for days but unsuccessful so I seek help.
It just a short code, please let me know if it needs more.
It's a study and when I do this:
Double lossema=series.ema(index,atrPeriod,Values.TRUERANGE);
all good, lines visible on the chart.
But when I do this:
Double lossema=1.5*series.ema(index,atrPeriod,Values.TRUERANGE);
Suddenly I have this error:
"java.lang.NullPointerException: Cannot invoke "java.lang. Double.doubleValue()" because "<local33>" is null at study_examples.ATR_TrailingStop.calculate(ATR_TrailingStop.java:129)"
It should be very simple and yet I can't solve it. Anyone can tell me what's wrong?
Thank you