View Single Post
  #9 (permalink)  
Old 04-15-2008, 10:22 PM
Michel Michel is offline
Senior Member
 
Join Date: Feb 2006
Posts: 558
Michel is on a distinguished road
Quote:
Originally Posted by tone40@inbox.com View Post
Hello Al here,

Need help to modify the following code line for mt4. this is a line that buys when all of the different 13 indicators are pointing up, I WOULD LIKE TO CHANGE IT SO IT BUYS WHEN 9 OUT OF 13 ARE POINTING UP, DONT CARE WHICH ONES, JUST 9 OUT OF 13, THATS ALL:

if (Buy1_1 > Buy1_2 && Buy2_1 > Buy2_2 && Buy3_1 > Buy3_2 && Buy4_1 > Buy4_2 && Buy5_1 > Buy5_2 && Buy6_1 > Buy6_2 && Buy7_1 > Buy7_2 && Buy8_1 > Buy8_2 && Buy9_1 > Buy9_2 && Buy10_1 > Buy10_2 && Buy11_1 > Buy11_2 && Buy12_1 > Buy12_2 && Buy13_1 > Buy13_2) Order = SIGNAL_BUY;

ANY IDEAS??

IM WILLING TO SHARE THE EA WHEN DONE.

Al
PHP Code:
int cnt = (Buy1_1 Buy1_2) + (Buy2_1 Buy2_2) + .... + (Buy13_1 Buy13_2);
if(
cnt 8Order SIGNAL_BUY
or, more easy to understand:
PHP Code:
int cnt 0;
if(
Buy1_1 Buy1_2cnt++;
if(
Buy2_1 Buy2_2cnt++;
.
.
.
if(
Buy13_1 Buy13_2cnt++;
if(
cnt 8Order SIGNAL_BUY

Last edited by Michel; 04-15-2008 at 10:29 PM.
Reply With Quote