Forum

Executing trades within a price range

I'm quite new to MQL and have trouble figuring this out. The current code I have keeps on spamming orders. Am I doing something wrong? for ( int i= 0 ;i< 10 ;i++){ if (closeprice>=prend[i] && closeprice<=prstart[i]){ Buy(); break ; }

Getting price range of 3 bars

Hi I‌'ve just started learning MQL have a question...... I‌ am trying to get the price range of 3 consecutive bars(the current bar, 1 before and 1 after). Help pls ‌