Forum

Array out of range error

int arrayLengthIndex = 28 ; string currencyArray[ 28 ] = { "USDCHF" , "GBPUSD" , "EURUSD" , "USDJPY" , "USDCAD" , "AUDUSD" , "EURGBP" , "EURAUD" , "EURCHF" , "EURJPY" , "GBPCHF" , "CADJPY" , "GBPJPY" , "AUDNZD" , "AUDCAD" , "AUDCHF" , "AUDJPY" , "CHFJPY" , "EURNZD"

Number of Consecutive Sell Losses and Buy Losses

Hi All I am trying to get the consecutive number of losses from within my EA. The number does count up but when i get a win ,either on buy or sell the counter does not reset. Is there something wrong with my code? void BuyCountLosses() { int LossBuy = 0 ; for ( cnt = OrdersHistoryTotal () - 1