I'm learning (attempting
) more about C# and Ninja library, and am trying to figure out the Slope() function. I made a strategy that will enter when the SMA reaches a certain slope, and exit when it reaches another. Here is the code: if (Slope(IDataSeries (SMA(N)), int 1, int 0)[0] >= S1)
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (Slope(IDataSeries (SMA(N)), int 1, int 0)[0] <= S2)
{
ExitLong("", "");
}

Comment