English

## Coding multiple strategy according to RSI level

 5 pipokito 2016.07.20 10:21   Dear all,I'm building a multiple strategy based on the RSI  levels: Between 30 and 70 use a certain strategy: Strategy N°0Between 70 and 85 or 30 and 15 I use strategy N°1And between 0 and 15 or 85 and 100 I use strategy N°2 (Although in order to move back to another strategy from srategy N°2 the RSI level has to reach the opposite RSI limit) I have tried to code this with the following MQL4 code but it didn't work. The value of X was stuck to 1 or 2 or -2 and 1 depending on the order of my instructions.The idea was then to say if X = ... then use strategy N°... Can someone enlight me or advise me on a simpler way to translate these instructions in MQL4 Thanks!Andrea  ```int X=0; extern int RSIU1=70; extern int RSIU2=85; extern int RSID1=30; extern int RSID2=15; double RSIX=iRSI(Symbol(),0,RSIXPeriod,0,0); if ((X=1)&&((RSIXRSID1))) X=0; if ((X=0)&&(((RSIX>RSIU1)&&(RSIXRSID2)))) X=1; if ((X=1)&&(RSIX>RSIU2)) X=2; if ((X=1)&&(RSIXRSIU1)) X=1; if ((X=2)&&(RSIX
 26 ceaser234 2016.07.20 12:30 #   Why are you declaring x to numbers inside the if else conditions.```if ((X=1)&&((RSIXRSID1))) X=0; if ((X=0)&&(((RSIX>RSIU1)&&(RSIXRSID2)))) X=1; if ((X=1)&&(RSIX>RSIU2)) X=2; if ((X=1)&&(RSIXRSIU1)) X=1; if ((X=2)&&(RSIXRSID1))) X=0; if ((X==0) && (((RSIX>RSIU1)&&(RSIXRSID2)))) X=1; if ((X==1) && (RSIX>RSIU2)) X=2; if ((X==1) && (RSIXRSIU1)) X=1; if ((X==2) && (RSIX