iMA egality problem - page 2 12 New comment [Deleted] 2013.03.23 16:39 #11 and if I makeint i=0; int magicalNumber,ticket; Moyenne1=iMA(NULL,PERIOD_M30,20,8,MODE_SMA,PRICE_CLOSE,i); Moyenne1bis=iMA(NULL,PERIOD_M30,20,8,MODE_SMA,PRICE_CLOSE,i+2); Moyenne2=iMA(NULL,PERIOD_M30,50,8,MODE_SMA,PRICE_CLOSE,i); Moyenne2bis=iMA(NULL,PERIOD_M30,50,8,MODE_SMA,PRICE_CLOSE,i+2); magicalNumber = 98765; if( Moyenne1 >= Moyenne2 ) { if( Moyenne1bis <= Moyenne2bis) { ticket = OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,"SELL",magicalNumber,0,Red); } }will it work ? William Roeder 2013.03.23 17:32 #12 Using i=0 means it will probably cross multiple times as the bar formswhy i+2? that is 2 bars ago, don't you want i+1? [Deleted] 2013.03.23 17:56 #13 i+2 for be sureok but will it takes order ? [Deleted] 2013.04.03 21:28 #14 reso heres my new code :int i=1; int magicalNumber,ticket; Moyenne1=iMA(NULL,PERIOD_M30,20,8,MODE_SMA,PRICE_CLOSE,i); Moyenne1bis=iMA(NULL,PERIOD_M30,20,8,MODE_SMA,PRICE_CLOSE,i+2); Moyenne2=iMA(NULL,PERIOD_M30,50,8,MODE_SMA,PRICE_CLOSE,i); Moyenne2bis=iMA(NULL,PERIOD_M30,50,8,MODE_SMA,PRICE_CLOSE,i+2); magicalNumber = 98765; if( Moyenne1 >= Moyenne2 ) { if( Moyenne1bis <= Moyenne2bis) { ticket = OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,"SELL",magicalNumber,0,Red); } }but why did it take so long to make order (it should take order at 18:00, not later ...) ? Simon Gniadkowski 2013.04.03 22:02 #15 Bad_Bond: reso heres my new code :but why did it take so long to make order (it should take order at 18:00, not later ...) ? Perhaps it's something to do with your setting for ma_shift of 8 ? did you set a shift of 8 for the MAs you have on your chart ? [Deleted] 2013.04.04 05:21 #16 yes, you're rightbut what does "ma_shift" mean ? Simon Gniadkowski 2013.04.04 08:52 #17 Bad_Bond: yes, you're rightbut what does "ma_shift" mean ? Red the documentation, use the Forum search . . . https://www.mql5.com/en/forum/140831 [Deleted] 2013.04.04 11:12 #18 yeah i knowbut i don't see the difference between MA_SHIFT and SHIFT Simon Gniadkowski 2013.04.04 11:22 #19 Bad_Bond: yeah i knowbut i don't see the difference between MA_SHIFT and SHIFT Do you see it now ? 12 New comment
and if I make
will it work ?
i+2 for be sure
ok but will it takes order ?
re
so heres my new code :
but why did it take so long to make order (it should take order at 18:00, not later ...) ?
re
so heres my new code :
but why did it take so long to make order (it should take order at 18:00, not later ...) ?
Perhaps it's something to do with your setting for ma_shift of 8 ? did you set a shift of 8 for the MAs you have on your chart ?
yes, you're right
but what does "ma_shift" mean ?
yes, you're right
but what does "ma_shift" mean ?
Red the documentation, use the Forum search . . .
https://www.mql5.com/en/forum/140831
yeah i know
but i don't see the difference between MA_SHIFT and SHIFT
yeah i know
but i don't see the difference between MA_SHIFT and SHIFT
Do you see it now ?