I have created a simple function (method) that retruns the double value of a fast moving EMA when it crosses a slower Simple Moving Average. Lets assume this method is named Crossover()
What I now need to do is somehow assign the values of Crossover() as they are occuring into some sort of dataseries or array so that can be called on in a strategy in a systematic fashion, e.g
If (Crossover() [1] < Crossover() [2])
{
Go Long
}
My question is how do you assign values from a method to a dataseries or array so that they can be called up from historical data numbering from [0] current value generated by method to [1] last value to[2] second last value and so on....
I would like the assigning to the dataseries or array to commence an hour before the start of the trading day and to end at the close of the trading day.
Comment