Do you know what MODE_MAIN means in iBands()?
For you code you don't need iBands() an iMA(..) would be enough - guess why!
Do you know what MODE_MAIN means in iBands()?
For you code you don't need iBands() an iMA(..) would be enough - guess why!
i think mode_main means middle line inside two lines above below
i want to place trade after ma period 1 shift 1 is above bands middle line. can you show me some code please
What is the length of your moving average?Your code Documentation iMA( NULL, 0, PERIOD_CURRENT, 1, MODE_SMA, PRICE_CLOSE, 1 )
double iMA( string symbol, // symbol int timeframe, // timeframe int ma_period, // MA averaging period int ma_shift, // MA shift int ma_method, // averaging method int applied_price, // applied price int shift // shift );
- Why did you post in the Root / MT5 General section instead of the MQL4 section (bottom of the Root page?)
whroeder1:
What is the length of your moving average?Your code Documentation - Why did you post in the Root / MT5 General section instead of the MQL4 section (bottom of the Root page?)
the moving average has a period of 1. the moving average is same as price. i posted in the root just because it was at the top of the page
iMA(Symbol(),PERIOD_CURRENT,1,0,MODE_SMA,PRICE_CLOSE,1); iBands(Symbol(),PERIOD_CURRENT,20,2,1,PRICE_CLOSE,MODE_MAIN,1);
boopa26: the moving average has a period of 1.
| No, it does not! That is you problem. |
whroeder1:
No, it does not! That is you problem. |
maybe you can show me some code please
if(iBands(Symbol(),PERIOD_CURRENT,20,2,1,PRICE_CLOSE,MODE_MAIN,1)<iMA(Symbol(),PERIOD_CURRENT,1,0,MODE_SMA,PRICE_CLOSE,1)&& OrdersTotal()==0) OrderSend(Symbol(),OP_BUY,lots,Ask,3,Ask-stoploss*Point,0,"",magic_number,0,Blue);i think its fixed now. thanks all

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hello im trying to code an expert advisor that does trade after moving average is higher than bands main (after bar closes. shift 1)
the code does not do what i want it to do. i read documentation but it does not give detailed information
https://docs.mql4.com/indicators/ibands