I developed an indicator in NT 7 that would draw an up arrow under a bar if it crossed a moving average with a slope greater than 0.
The code looked like this:
if Slope(SMA(50)[0] > 0) && ) then...
I read various posts on how to do it in NT 8 (including in the strategy builder), but I'm a bit lost on the correct syntax.
Any pointer would be much appreciated.
Thanks
EDIT: With the strategy builder I get this, but I'd like to call the Slope of the SMA directly (instead of through a variable like SMA1), like in the above example.
{
SMA1 = SMA(Close, 50);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 0)
return;
// Set 1
if (Slope(SMA1, 0, 0) > 0)
{
}
Comment