whitmark
07-15-2007, 10:45 AM
I am working on a multiple-timeframe strategy that uses three timeframes in all and has some fairly envolved logic for each. Once I resolve each timeframe's partial trading signal, I hope to push this value (or related values) to its own data series such that I can evaluate the conditions (for the current bar and previous bars) across all timeframes before submitting a trade as follows:
...
if (BarsInProgress == 0)
{
if (ThisComplexTimeFrame0LogicTrue)
MTF1signal.Set(1);
}
if (BarsInProgress == 1)
{
if (ThisComplexTimeFrame1LogicTrue)
MTF2signal.Set(1);
}
if (BarsInProgress == 2)
{
if (ThisComplexTimeFrame2LogicTrue)
MTF3signal.Set(1);
}
...
if (BarsInProgress == 0)
{
if (MTF1signal[0] == 1 &&
MTF1signal[1] != 1 &&
MTF2signal[0] == 1 &&
MTF2signal[1] != 1 &&
MTF3signal[0] == 1 &&
MTF3signal[1] != 1 )
{
EnterLong();
}
}
...
In this context, I would think that the reference to MTF3signal[0] would be the last value I set when BarsInProgress == 2. However, I am getting results that suggest that DataSeries collections are only available for the BarsArray[0] series. Please confirm.
While in a BarsInProgress = 0 event, is there a way to get dataseries values that where set during other BarsInProgress events? if I can't get this to work, I will likely substitute the dataseries with private variables, arrays, or queues.
Regards,
Whitmark
...
if (BarsInProgress == 0)
{
if (ThisComplexTimeFrame0LogicTrue)
MTF1signal.Set(1);
}
if (BarsInProgress == 1)
{
if (ThisComplexTimeFrame1LogicTrue)
MTF2signal.Set(1);
}
if (BarsInProgress == 2)
{
if (ThisComplexTimeFrame2LogicTrue)
MTF3signal.Set(1);
}
...
if (BarsInProgress == 0)
{
if (MTF1signal[0] == 1 &&
MTF1signal[1] != 1 &&
MTF2signal[0] == 1 &&
MTF2signal[1] != 1 &&
MTF3signal[0] == 1 &&
MTF3signal[1] != 1 )
{
EnterLong();
}
}
...
In this context, I would think that the reference to MTF3signal[0] would be the last value I set when BarsInProgress == 2. However, I am getting results that suggest that DataSeries collections are only available for the BarsArray[0] series. Please confirm.
While in a BarsInProgress = 0 event, is there a way to get dataseries values that where set during other BarsInProgress events? if I can't get this to work, I will likely substitute the dataseries with private variables, arrays, or queues.
Regards,
Whitmark