how to test? i have error about hedging in USD/EUR
2018.05.12 21:13:01.827 Core 1 1971.05.26 00:00:00 Hedging only!
2018.05.12 21:13:01.827 Core 1 tester stopped because OnInit failed
how to test? i have error about hedging in USD/EUR
2018.05.12 21:13:01.827 Core 1 1971.05.26 00:00:00 Hedging only!
2018.05.12 21:13:01.827 Core 1 tester stopped because OnInit failed
This advisor can only work on trading accounts with a hedge accounting system positions.
how to test? i have error about hedging in USD/EUR
2018.05.12 21:13:01.827 Core 1 1971.05.26 00:00:00 Hedging only!
2018.05.12 21:13:01.827 Core 1 tester stopped because OnInit failed
note que na inicialização ele valida se seu tipo de conta é de cobertura, caso ele retorna erro de inicialização.
você pode remover esse trecho de codigo, porem vai de encontro com a ideia do autor. Ou abrir uma conta do tipo hedding, no momento da abertura vc deve marcar essa opção, todas as novas contas por padrão nascem como neting.
o trecho que valida sua conta é:
int OnInit() { SetMarginMode(); if(!IsHedging()) { Print("Hedging only!"); return(INIT_FAILED); } ... }
referencias:
https://www.mql5.com/pt/docs/constants/environment_state/accountinformation
https://www.mql5.com/pt/forum/91033
Att,
Jonathan Pereira

- www.mql5.com
Code
//+------------------------------------------------------------------+ //| TradeTransaction function | //+------------------------------------------------------------------+ void OnTradeTransaction ( const MqlTradeTransaction &trans, const MqlTradeRequest &request, const MqlTradeResult &result) { //--- get transaction type as enumeration value ENUM_TRADE_TRANSACTION_TYPE type=trans.type; //--- if transaction is result of addition of the transaction in history if (type== TRADE_TRANSACTION_DEAL_ADD ) { long deal_entry = 0 ; double deal_profit = 0.0 ; string deal_symbol = "" ; long deal_magic = 0 ; if ( HistoryDealSelect (trans.deal)) { deal_entry= HistoryDealGetInteger (trans.deal, DEAL_ENTRY ); deal_profit= HistoryDealGetDouble (trans.deal, DEAL_PROFIT ); deal_symbol= HistoryDealGetString (trans.deal, DEAL_SYMBOL ); deal_magic= HistoryDealGetInteger (trans.deal, DEAL_MAGIC ); } else return ; if (deal_symbol== Symbol () && deal_magic==m_magic) if (deal_entry== DEAL_ENTRY_OUT ) { if (deal_profit> 0 ) lot_last=InpLot; else { lot_last=InpLot* 1.6 ; lot_last=LotCheck(lot_last); } } } }
significa:
Se pegarmos uma transação OUT (Out of the Market) e o lucro de uma transação for negativo, aumentamos o “объем” em 1,6.
Confirmando,
Compra => fechamento da barra 3 > fechamento da barra 2 e fechamento da barra 2 > fechamento da barra 1
Venda => fechamento da barra 3 < fechamento da barra 2 e fechamento da barra 2 < fechamento da barra 1
Barra 1 é a atual, barra 2 é a anterior, e barra 3 é a anterior à barra 2
Correto ? ...grato
Извините, я не понимаю. Даже Goole Переводчик не помогает. Я не понимаю ни одного Вашего слова.

- Aplicativos de negociação gratuitos
- 8 000+ sinais para cópia
- Notícias econômicas para análise dos mercados financeiros
Você concorda com a política do site e com os termos de uso
E-Skoch-Open:
Autor: Vladimir Karputov