else // in case ping failed or requote { if(ExistPositions(BaseSymbol, MagicNo) == 1&& TotalCurProfit(MagicNo)>AcceptableLoss$) -------------------> ЗДЕСЬ { CloseScrap(BaseSymbol, ExistOP(BaseSymbol, MagicNo), MagicNo); } else if(ExistPositions(H_Symbol, MagicNo) == 1&& TotalCurProfit(MagicNo) > AcceptableLoss$) ----------------------> И ЗДЕСЬ { CloseScrap(H_Symbol, ExistOP(H_Symbol, MagicNo), MagicNo); } } Эти условия всегда будут справедливы, а позиции будут сразу закрываться после открытия... This conditions are always true, so orders would be closed just after opening. With Regartds - S,D.
{ return(true); -- ? Return before next commands. PlaySound don't work never. if(PlayAudio) {PlaySound ... ;} }
I am having a problem with sending the hedge using this method. The base symbol is opening OK but the Hedge is giving an Invalid Price error. Any ideas????
What is the point in having a code that is not backtestable?
Hi, I am studying this, but in this core function :
double Cor(string base, string hedge) { double u1=0,l1=0,s1=0; for(int i = CorPeriod - 1; i >= 0; i--) { u1 += u(symboldif(base, i), symboldif(hedge, i)); l1 += powdif(symboldif(base, i)); s1 += powdif(symboldif(hedge, i)); } if(l1*s1 > 0) return(u1 / MathSqrt(l1*s1)); }
u1 / MathSqrt(l1*s1) , basically return , always return i mean , "1" ,
because MathSqrt(l1 * s1) = symoboldif(base, i) * symboldif(hedge, i) ...
I wonder why the admin created an blog with MQL5 in the url that contains almost more mql4 code than mql5 code ...
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
New article The Basic of Coding A Hedge Expert Advisor has been published:
Author: chayutra sriboonruang