i want to use multiple classes in my strategy. Unfortunately i´m not able to use Price Series like High[], Low[], Open[] and close.
Here is an basic example for my problem:
public class Thisismystrategy : Strategy { CompareClass CC1 = new CompareClass(); CC1.CompareWithHigh(10, 123,12); // Now i have access in my main class / strategy to following values // CC1.ValueIsHigherThanHighs // CC1.LastBarWhatIsHigherThanValue // CC1.HighOfThisBar } public class CompareClass : Strategy { private int i; public bool ValueIsHigherThanHighs = false public int LastBarWhatIsHigherThanValue = 0; public double HighOfThisBar = 0; public void CompareWithHigh (int AmountofBars, double PredefinedValue) { for(i = 1; i <= AmountofBars; i ++) { if(High[i] > PredefinedValue) { ValueIsHigherThanHighs = false; LastBarWhatIsHigherThanValue = i; HighOfThisBar = High[i]; break; } if(i == AmountofBars) { ValueIsHigherThanHighs = true; break; } } } }
It seems like CompareClass has no access to Price Series like the High[] in this case. How can i solve this problem?
Comment