1) I think I want my arrays to have a specific size. So I've been creating them like so:
#region Variables private int loCount = 0; private DataSeries swingLow; #endregion protected override void Initialize() { double[] swingLow = new double[loCount]; // Collect all the swingLows } protected override void OnBarUpdate() { if (some conditions are satisfied, add one to swing loCount number, shift all previous values to the right and create a new, latest swingLow point at [0]) { loCount = loCount +1; for (int i = loCount; i > 0; i--) { swingLow[i] = swingLow[i-1]; } } } swingLow[0] = Low[2];
2) I created another array, I wanted it to contain boolean values, true or false.
//Variables
private bool oneTime = true;
private DataSeries tradeOK;
//Initialize
bool[] tradeOK = new bool[oTot];
//OnBarUpdate
while (oneTime == true) // Want it to assign all the values in this array initially as true.... { for (int i = 0; i < oTot; i++) { tradeOK[i] = true; } oneTime = false; } // then later, i run a loop trying to find the first entry that has a tradeOK[z] = true value int z = 0; while (z < oTot) { if (tradeOK[z] = true) { ....
Hope everything is clear enough - thanks in advance for the help!
Steve
Comment