Download MetaTrader 5

Examples: The Basic of Coding A Hedge Expert Advisor

To add comments, please log in or register
Have you developed an application? Publish it in Code Base!
MetaQuotes Software Corp.
MetaQuotes Software Corp. 2007.07.09 12:27 

New article The Basic of Coding A Hedge Expert Advisor has been published:

An example of hedge Expert Advisor is just presented in this article. The author will choose its very own favorite hedge pair that is EURJPY & GBPJPY. It always moves the same way, easier to set the hedging order type.

Author: chayutra sriboonruang

Sart 2007.07.16 11:28  
else // in case ping failed or requote 
            if(ExistPositions(BaseSymbol, MagicNo) == 1&&
               TotalCurProfit(MagicNo)>AcceptableLoss$) -------------------> ЗДЕСЬ
                CloseScrap(BaseSymbol, ExistOP(BaseSymbol, 
                           MagicNo), MagicNo); 
                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.
baal79 2011.09.23 19:43  
{ return(true);                    -- ? Return before next commands. PlaySound don't work never.
  if(PlayAudio) {PlaySound ... ;}   
Lukasz Starczewski
Lukasz Starczewski 2012.03.08 09:19  
I get "No Swap Condition To Gain From : pls modify one or more input parameter(s)". What is causing that? How to make it work?
Silverthorn 2014.05.10 02:18  
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????
To add comments, please log in or register