세뇌: 시스템 개발 - 페이지 6 123456 새 코멘트 ffoorr 2018.10.27 21:10 #51 동일한 EA, BrainTrend1Sig 신호 사용 //+------------------------------------------------------------------+ //| EA_BrainTrend1Sig.mq4 | //| Copyright 2018, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2018, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict extern bool open_buy = true ; extern bool open_sell = true ; extern int MagicNumber = 451 ; extern double StopLoss = 135 ; extern double TakeProfit = 400 ; extern double lots = 0.1 ; string Text ; extern int Tral_Stop = 180 ; // double signal_up = iCustom(NULL,0,"NK//Plus//BrainTrend//BrainTrend1Sig", EnableAlerts,SignalID, Input_Price_Customs,0,1 ); extern int EnableAlerts= 0 ; extern int SignalID= 0 ; extern int Input_Price_Customs = 0 ; //Âûáîð öåí, ïî êîòîðûì ïðîèçâîäèòñÿ ðàñ÷¸ò èíäèêàòîðà datetime time0; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit () { //--- //--- return ( INIT_SUCCEEDED ); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit ( const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick () { //--- if ( time0 == Time [ 0 ] ) return ; time0= Time [ 0 ]; if ( count_tip( OP_BUY ) > 0 ) trailing_stop(); if ( count_tip( OP_SELL ) > 0 ) trailing_stop(); // double signal_up = iCustom(NULL,0,"NK//Plus//BrainTrend//BrainTrend1Sig", EnableAlerts,SignalID, Input_Price_Customs,1,1 ); double signal_up = iCustom ( NULL , 0 , "BrainTrend1Sig" , EnableAlerts,SignalID, Input_Price_Customs, 1 , 1 ); double sl_buy = MathMin ( Bid - StopLoss* Point , signal_up ); if ( signal_up != 0.0 && open_buy && count_tip( OP_BUY ) == 0 ) { int ticket_buy = OrderSend ( _Symbol , OP_BUY , lots, Ask , 3 , sl_buy, Ask +TakeProfit* Point , "RsiEma" , MagicNumber); } // double signal_down = iCustom(NULL,0,"NK//Pluas//BrainTrend//BrainTrend1Sig", EnableAlerts,SignalID, Input_Price_Customs,0,1 ); double signal_down = iCustom ( NULL , 0 , "BrainTrend1Sig" , EnableAlerts,SignalID, Input_Price_Customs, 0 , 1 ); double sl_sell = MathMax ( Ask + StopLoss* Point , signal_down ); if ( signal_down != 0.0 && open_sell && count_tip( OP_SELL ) == 0 ) { int ticket_sell = OrderSend ( _Symbol , OP_SELL , lots, Bid , 3 , sl_sell, Bid - TakeProfit* Point , "RsiEma" , MagicNumber); } } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ int count_tip( int tip = - 1 ) { int cpte_order = 0 ; for ( int i = ( OrdersTotal ()- 1 ); i >= 0 ; i--) { if ( OrderSelect (i, SELECT_BY_POS , MODE_TRADES ) == false ) continue ; if ( OrderMagicNumber ()==MagicNumber && OrderType ()== tip) cpte_order++; } return (cpte_order); } //+------------------------------------------------------------------+ // https://book.mql4.com/trading/ordermodify //------------------------------------------------------------------------------- 1 -- void trailing_stop ( ) // Special function 'start' { string Symb= Symbol (); // Symbol //------------------------------------------------------------------------------- 2 -- for ( int i= 1 ; i<= OrdersTotal (); i++) // Cycle searching in orders { if ( OrderSelect (i- 1 , SELECT_BY_POS )== true ) // If the next is available { // Analysis of orders: int Tip= OrderType (); // Order type if ( OrderSymbol ()!=Symb||Tip> 1 ) continue ; // The order is not "ours" double SL= OrderStopLoss (); // SL of the selected order //---------------------------------------------------------------------- 3 -- while ( true ) // Modification cycle { double TS=Tral_Stop; // Initial value int Min_Dist= ( int ) MarketInfo (Symb, MODE_STOPLEVEL ); //Min. distance if (TS < Min_Dist) // If less than allowed TS=Min_Dist; // New value of TS //------------------------------------------------------------------- 4 -- bool Modify= false ; // Not to be modified switch (Tip) // By order type { case 0 : // Order Buy if ( NormalizeDouble (SL, Digits )< // If it is lower than we want NormalizeDouble ( Bid -TS* Point , Digits )) { SL= Bid -TS* Point ; // then modify it Text= "Buy " ; // Text for Buy Modify= true ; // To be modified } break ; // Exit 'switch' case 1 : // Order Sell if ( NormalizeDouble (SL, Digits )> // If it is higher than we want NormalizeDouble ( Ask +TS* Point , Digits ) || NormalizeDouble (SL, Digits )== 0 ) //or equal to zero { SL= Ask +TS* Point ; // then modify it Text= "Sell " ; // Text for Sell Modify= true ; // To be modified } } // End of 'switch' if (Modify== false ) // If it is not modified break ; // Exit 'while' //------------------------------------------------------------------- 5 -- double TP = OrderTakeProfit (); // TP of the selected order double Price = OrderOpenPrice (); // Price of the selected order int Ticket= OrderTicket (); // Ticket of the selected order Alert ( "Modification " ,Text,Ticket, ". Awaiting response.." ); bool Ans= OrderModify (Ticket,Price,SL,TP, 0 ); //Modify it! //------------------------------------------------------------------- 6 -- if (Ans== true ) // Got it! :) { Alert ( "Order " ,Text,Ticket, " is modified:)" ); break ; // From modification cycle. } //------------------------------------------------------------------- 7 -- int Error= GetLastError (); // Failed :( switch (Error) // Overcomable errors { case 130 : Alert ( "Wrong stops. Retrying." ); RefreshRates (); // Update data continue ; // At the next iteration case 136 : Alert ( "No prices. Waiting for a new tick.." ); while ( RefreshRates ()== false ) // To the new tick Sleep ( 1 ); // Cycle delay continue ; // At the next iteration case 146 : Alert ( "Trading subsystem is busy. Retrying " ); Sleep ( 500 ); // Simple solution RefreshRates (); // Update data continue ; // At the next iteration // Critical errors case 2 : Alert ( "Common error." ); break ; // Exit 'switch' case 5 : Alert ( "Old version of the client terminal." ); break ; // Exit 'switch' case 64 : Alert ( "Account is blocked." ); break ; // Exit 'switch' case 133 : Alert ( "Trading is prohibited" ); break ; // Exit 'switch' default : Alert ( "Occurred error " ,Error); //Other errors } break ; // From modification cycle } // End of modification cycle //---------------------------------------------------------------------- 8 -- } // End of order analysis } // End of order search //------------------------------------------------------------------------------- 9 -- return ; // Exit start() } //---------------------------------------------------------------- ffoorr 2018.10.27 21:12 #52 bt ; ffoorr 2018.10.27 21:52 #53 수익 차트가 보이시나요? 1승 1패이므로 마틴게일과 함께 사용할 수 있습니다. EA_BrainTrend1Sig //+------------------------------------------------------------------+ //| EA_BrainTrend1Sig.mq4 | //| Copyright 2018, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2018, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict extern bool open_buy = 0 ; extern bool open_sell = true ; extern int MagicNumber = 451 ; extern double StopLoss = 135 ; extern double TakeProfit = 400 ; extern double lots = 0.1 ; string Text ; extern int Tral_Stop = 180 ; extern bool use_mart = true ; // double signal_up = iCustom(NULL,0,"NK//Plus//BrainTrend//BrainTrend1Sig", EnableAlerts,SignalID, Input_Price_Customs,0,1 ); extern int EnableAlerts= 0 ; extern int SignalID= 0 ; extern int Input_Price_Customs = 0 ; //Âûáîð öåí, ïî êîòîðûì ïðîèçâîäèòñÿ ðàñ÷¸ò èíäèêàòîðà datetime time0; double llots = 0.0 ; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit () { //--- //--- return ( INIT_SUCCEEDED ); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit ( const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick () { //--- if ( time0 == Time [ 0 ] ) return ; time0= Time [ 0 ]; if ( count_tip( OP_BUY ) > 0 ) trailing_stop(); if ( count_tip( OP_SELL ) > 0 ) trailing_stop(); llots = lots; if (use_mart ) llots = martingale_lots(); Print ( " llots " ,( string ) llots); double signal_up = iCustom ( NULL , 0 , "NK//Plus//BrainTrend//BrainTrend1Sig" , EnableAlerts,SignalID, Input_Price_Customs, 1 , 1 ); // double signal_up = iCustom(NULL,0,"BrainTrend1Sig", EnableAlerts,SignalID, Input_Price_Customs,1,1 ); double sl_buy = MathMin ( Bid - StopLoss* Point , signal_up ); if ( signal_up != 0.0 && open_buy && count_tip( OP_BUY ) == 0 ) { int ticket_buy = OrderSend ( _Symbol , OP_BUY , llots, Ask , 3 , sl_buy, Ask +TakeProfit* Point , "RsiEma" , MagicNumber); } double signal_down = iCustom ( NULL , 0 , "NK//Plus//BrainTrend//BrainTrend1Sig" , EnableAlerts,SignalID, Input_Price_Customs, 0 , 1 ); // double signal_down = iCustom(NULL,0,"BrainTrend1Sig", EnableAlerts,SignalID, Input_Price_Customs,0,1 ); double sl_sell = MathMax ( Ask + StopLoss* Point , signal_down ); if ( signal_down != 0.0 && open_sell && count_tip( OP_SELL ) == 0 ) { int ticket_sell = OrderSend ( _Symbol , OP_SELL , llots, Bid , 3 , sl_sell, Bid - TakeProfit* Point , "RsiEma" , MagicNumber); } } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ int count_tip( int tip = - 1 ) { int cpte_order = 0 ; for ( int i = ( OrdersTotal ()- 1 ); i >= 0 ; i--) { if ( OrderSelect (i, SELECT_BY_POS , MODE_TRADES ) == false ) continue ; if ( OrderMagicNumber ()==MagicNumber && OrderType ()== tip) cpte_order++; } return (cpte_order); } //+------------------------------------------------------------------+ // https://book.mql4.com/trading/ordermodify //------------------------------------------------------------------------------- 1 -- void trailing_stop ( ) // Special function 'start' { string Symb= Symbol (); // Symbol //------------------------------------------------------------------------------- 2 -- for ( int i= 1 ; i<= OrdersTotal (); i++) // Cycle searching in orders { if ( OrderSelect (i- 1 , SELECT_BY_POS )== true ) // If the next is available { // Analysis of orders: int Tip= OrderType (); // Order type if ( OrderSymbol ()!=Symb||Tip> 1 ) continue ; // The order is not "ours" double SL= OrderStopLoss (); // SL of the selected order //---------------------------------------------------------------------- 3 -- while ( true ) // Modification cycle { double TS=Tral_Stop; // Initial value int Min_Dist= ( int ) MarketInfo (Symb, MODE_STOPLEVEL ); //Min. distance if (TS < Min_Dist) // If less than allowed TS=Min_Dist; // New value of TS //------------------------------------------------------------------- 4 -- bool Modify= false ; // Not to be modified switch (Tip) // By order type { case 0 : // Order Buy if ( NormalizeDouble (SL, Digits )< // If it is lower than we want NormalizeDouble ( Bid -TS* Point , Digits )) { SL= Bid -TS* Point ; // then modify it Text= "Buy " ; // Text for Buy Modify= true ; // To be modified } break ; // Exit 'switch' case 1 : // Order Sell if ( NormalizeDouble (SL, Digits )> // If it is higher than we want NormalizeDouble ( Ask +TS* Point , Digits ) || NormalizeDouble (SL, Digits )== 0 ) //or equal to zero { SL= Ask +TS* Point ; // then modify it Text= "Sell " ; // Text for Sell Modify= true ; // To be modified } } // End of 'switch' if (Modify== false ) // If it is not modified break ; // Exit 'while' //------------------------------------------------------------------- 5 -- double TP = OrderTakeProfit (); // TP of the selected order double Price = OrderOpenPrice (); // Price of the selected order int Ticket= OrderTicket (); // Ticket of the selected order Alert ( "Modification " ,Text,Ticket, ". Awaiting response.." ); bool Ans= OrderModify (Ticket,Price,SL,TP, 0 ); //Modify it! //------------------------------------------------------------------- 6 -- if (Ans== true ) // Got it! :) { Alert ( "Order " ,Text,Ticket, " is modified:)" ); break ; // From modification cycle. } //------------------------------------------------------------------- 7 -- int Error= GetLastError (); // Failed :( switch (Error) // Overcomable errors { case 130 : Alert ( "Wrong stops. Retrying." ); RefreshRates (); // Update data continue ; // At the next iteration case 136 : Alert ( "No prices. Waiting for a new tick.." ); while ( RefreshRates ()== false ) // To the new tick Sleep ( 1 ); // Cycle delay continue ; // At the next iteration case 146 : Alert ( "Trading subsystem is busy. Retrying " ); Sleep ( 500 ); // Simple solution RefreshRates (); // Update data continue ; // At the next iteration // Critical errors case 2 : Alert ( "Common error." ); break ; // Exit 'switch' case 5 : Alert ( "Old version of the client terminal." ); break ; // Exit 'switch' case 64 : Alert ( "Account is blocked." ); break ; // Exit 'switch' case 133 : Alert ( "Trading is prohibited" ); break ; // Exit 'switch' default : Alert ( "Occurred error " ,Error); //Other errors } break ; // From modification cycle } // End of modification cycle //---------------------------------------------------------------------- 8 -- } // End of order analysis } // End of order search //------------------------------------------------------------------------------- 9 -- return ; // Exit start() } //---------------------------------------------------------------- //+------------------------------------------------------------------+ double martingale_lots() { int cpte_loss= 0 ; if ( OrdersHistoryTotal () == 0 ) return ( 0.1 ) ; for ( int i = ( OrdersHistoryTotal ()- 10 ); i <= OrdersHistoryTotal ()- 1 ; i++) { if ( OrderSelect (i, SELECT_BY_POS , MODE_HISTORY ) == false ) continue ; if ( OrderMagicNumber ()==MagicNumber ) { if ( OrderProfit () < 0 ) cpte_loss++; else cpte_loss = 1 ; } Print ( " cpte_loss " ,( string ) cpte_loss); } return (cpte_loss*lots ) ; } ffoorr 2018.10.27 21:54 #54 BT ; ffoorr 2018.10.27 22:17 #55 분실의 경우 1회 로트를 2배로 하면 : extern int max_cpte_loss = 2 ; //+------------------------------------------------------------------+ double martingale_lots() { int cpte_loss= 0 ; if ( OrdersHistoryTotal () == 0 ) return ( 0.1 ) ; for ( int i = ( OrdersHistoryTotal ()- 10 ); i <= OrdersHistoryTotal ()- 1 ; i++) { if ( OrderSelect (i, SELECT_BY_POS , MODE_HISTORY ) == false ) continue ; if ( OrderMagicNumber ()==MagicNumber ) { if ( OrderProfit () < 0 ) cpte_loss++; else cpte_loss = 1 ; } Print ( " cpte_loss " ,( string ) cpte_loss); } if ( cpte_loss <= max_cpte_loss) return (cpte_loss*lots* 2 ) ; else return (lots ) ; } BT 2018년 1월 2018년 10월 더 나은 : Sergey Golubev 2019.07.03 16:32 #56 세뇌 시스템 시작 세뇌 . 거래: 수동 및 EA 사용(MT4) 세뇌 EA - 스레드 (MT4) 세뇌: 수동 거래 및 EA(MT4)를 위한 시스템 설정 - 스레드 세뇌: 시스템 개발(MT4) - 스레드 후에 세뇌 시스템/AscTrend 시스템(MT5) - 스레드 123456 새 코멘트 트레이딩 기회를 놓치고 있어요: 무료 트레이딩 앱 복사용 8,000 이상의 시그널 금융 시장 개척을 위한 경제 뉴스 등록 로그인 공백없는 라틴 문자 비밀번호가 이 이메일로 전송될 것입니다 오류 발생됨 Google으로 로그인 웹사이트 정책 및 이용약관에 동의합니다. 계정이 없으시면, 가입하십시오 MQL5.com 웹사이트에 로그인을 하기 위해 쿠키를 허용하십시오. 브라우저에서 필요한 설정을 활성화하시지 않으면, 로그인할 수 없습니다. 사용자명/비밀번호를 잊으셨습니까? Google으로 로그인
동일한 EA, BrainTrend1Sig 신호 사용
bt ;
수익 차트가 보이시나요?
1승 1패이므로 마틴게일과 함께 사용할 수 있습니다. EA_BrainTrend1Sig
BT ;
분실의 경우 1회 로트를 2배로 하면
:
BT 2018년 1월 2018년 10월 더 나은 :
시작
후에