I'm a newcomer to NinjaScript and I'm trying to write a simple indicator based on SMA of the previous bar
After trying several times my indicator never plots a line.
I´ve simplified the code to the minimum still showing the problem, so it's easier to debug:
This is the standard code for mycustomindicator:
[FONT="Courier New"] {
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(Close[0]);
}[/FONT]
[FONT="Courier New"] {
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(EMA (Close, 25) [0]);
}[/FONT]
But if I just modify it in this way to shift the indicator one bar, the indicator disappears from the chart:
[FONT="Courier New"] {
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(EMA (Close, 25) [1]);
}
[/FONT]
But please, could anybody give me a hint?
Best regards
Francisco

Comment