-
Why did you post your MT4
question in the Root / MT5 General
section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - Posting code that neither buys or sells.
In the above code, the ea is putting only buy orders not sell orders, please help where did i go wrong, Thanks in advance
My recommendation: give better names to your variables first... e.g. instead of Buy1_1, change to X_Y_Z where X = MA/SAR/MACD, Y = moving average period, and Z = bar number.
If you do it correctly, you don't need to have two variables (one Buy and one Sell) for the same indicator value... and your condition checks for buy/sell orders will be easier to check.
In the above code, the ea is putting only buy orders not sell orders, please help where did i go wrong, Thanks in advance
You mean to say that all these indi values can be taken in a a single variable? I kindly request you to give an example please
You mean to say that all these indi values can be taken in a a single variable? I kindly request you to give an example please
Example:
double Buy1_1 = iMA(NULL, 0, 21, 0, MODE_EMA, PRICE_CLOSE, 2); double Sell1_1 = iMA(NULL, 0, 21, 0, MODE_EMA, PRICE_CLOSE, 2); becomes double MA21_2 = iMA(NULL, 0, 21, 0, MODE_EMA, PRICE_CLOSE, 2);
Thx for your example. But if you can extend your help , can you please check whether my conditions are correct, if it wrong can you fix it. Thx in advance
Thx for your example. But if you can extend your help , can you please check whether my conditions are correct, if it wrong can you fix it. Thx in advance
Rename your variables, then rewrite your conditions with those new names and post here.
Show us that you're willing to help yourself by learning and trying, rather than just asking for free help...
Rename your variables, then rewrite your conditions with those new names and post here.
Show us that you're willing to help yourself by learning and trying, rather than just asking for free help...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use