Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
-
double MFIValue=iMFI(Symbol(),Period(),MFIPeriod,0);
Why did you post your MT4 question in the 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? (2017)
Next time, post in the correct place. The moderators will likely move this thread there soon. -
takeProfit=Bid+TakeProfitPips*MarketInfo(Symbol(),MODE_POINT); stopLoss=Ask-StopLossPips*MarketInfo(Symbol(),MODE_POINT); ticket=OrderSend(Symbol(),OP_BUY,lotSize,Ask,SLIPPAGE,stopLoss,takeProfit,"",0,0,clrNONE);
You buy at the Ask and sell at the Bid. Pending Buy Stop orders become market orders when hit by the Ask.
-
Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice reaches it. Using Ask±n, makes your SL shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?
-
Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice reaches it. To trigger close at a specific Bid price, add the average spread.
MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25 -
The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (control+O) → charts → Show ask line.)
Most brokers with variable spreads widen considerably at end of day (5 PM ET) ± 30 minutes.
My GBPJPY shows average spread = 26 points, average maximum spread = 134.
My EURCHF shows average spread = 18 points, average maximum spread = 106.
(your broker will be similar).
Is it reasonable to have such a huge spreads (20 PIP spreads) in EURCHF? - General - MQL5 programming forum (2022)
-
-
Check your return codes, and report your errors (including market prices and your variables). Don't look at GLE/LE unless you have an error. Don't just silence the compiler (MT5 / MT4+strict), it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 programming forum (2012)
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles (2014) - Joseph Fakhoury: I dont have a better idea how to specify SMMAValue and Engulfing pattern ..
bool IsBullishEngulfing() { double currentOpen=iOpen(Symbol(),Period(),0); double currentClose=iClose(Symbol(),Period(),0); double previousOpen=iOpen(Symbol(),Period(),1); double previousClose=iClose(Symbol(),Period(),1);
You don't have an Engulfing pattern on the forming candle. Only when the candle completes, can you check. Wait for a new bar and check one (1) and two (2).
-
Trading View's RMA is the same as MT's SMMA. Never any reason to use the SMMA(L) or RMA(L). They are equivalent to the EMA(2L-1).
The Smoothed Moving Average or SMMA - How to Avoid It - NinjaTrader Programming | futures.io (2019)Drop your function (it does not compute SMMA) and use ima.
We are not here to code things for you, only to guide you in your own research to resolve the issues yourself.
If you wish for someone to code it for you, then please use the Freelance section instead.
- 2023.10.31
- www.mql5.com
- Usually people who can't code don't receive free help on this forum.
- If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
- To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Documentation.
- If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
- Finally, you also have the option to hire a programmer in the Freelance section.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
please for help Ea dosnt follow rules specified for order open,
its not opening trades in regard to correct site of SMMAValue? and dosnt fillter trades by engulfing pattern candle as its stated here: if(IsBearishEngulfing() && MFITrend==-1 && Close[1]<SMMAValue) ?
I dont have a better idea how to specify SMMAValue and Engulfing pattern ..
Thanks For Help !!