TThe problem is that I don't know how to diferentiate from 1 minute or 15 seconds candles.
If tryied this:
// check if volume is greather than last 3 candles if ((Volume[1] > Volume[2]) && (Volume[1] > Volume[3]) && (Volume[1] > Volume[4])){ double highest_price = 0; double lowest_price = 0; for (int i = 0; i < Bars.GetBar(Time[1], PeriodType.Second, subTimeFrame).Count; i++){ if ((Sim22_DeltaV21.DeltaClose[i] >= 60) || (Sim22_DeltaV21.DeltaClose[i] <= -60)){ // check if the current candle lowa and hight is greather than the one saved on the variables if(High[i] > highest_price){ highest_price = High[i]; } if(Low[i] < lowest_price){ lowest_price = Low[i]; } } } // if the highest price and lowest price is still 0, it means that we have to take the lowa and high price of the whole canlde if((lowest_price == 0) && (highest_price == 0)){ highest_price = High[1]; lowest_price = Low[1]; } // enter a long position }
Comment