어드바이저를 무작위로 모으는 방법 - 페이지 47

 

그럼에도 불구하고 코드에 차이가 있으며 표시기에서 다른 신호를 수신합니다.

그렇다면 더 적은 수의 지표가 적절합니다.

 //---
   double BuyBuffer[];
   double SellBuffer[];
   ArraySetAsSeries (BuyBuffer, true );
   ArraySetAsSeries (SellBuffer, true );
   if (!iGetArray(handle_iCustom, 1 , 0 , 2 ,BuyBuffer) || !iGetArray(handle_iCustom, 0 , 0 , 2 ,SellBuffer))
     {
      ExtPrevBarsY= 0 ;
       return ( false );
     }
//---
   if (BuyBuffer[ 1 ]!= 0.0 )
     {

그리고 이렇게 하면 더 잘 작동합니다.

 //---
   double main[],signal[];
   ArraySetAsSeries (main, true );
   ArraySetAsSeries (signal, true );
   int start_pos= 0 ,count= 3 ;
   if (!iGetArray(handle_iCustom, MAIN_LINE ,start_pos,count,main) ||
      !iGetArray(handle_iCustom, SIGNAL_LINE ,start_pos,count,signal))
     {
      ExtPrevBarsY= 0 ;
       return ( false );
     }

   if (main[ 1 ]>signal[ 1 ])
     {

이렇게 변경되었습니다! 나는 여전히 성능에 대해 전문가를 확인하고 있으며 모든 것이 작동하는 것 같습니다.

표시기에서 잘 작동합니다. 이 유형(아래 파일)

파일:
2.mq5  17 kb
 

포지션 을 열고 닫는 것을 혼동하지 않도록 모든 라인과 인디케이터를 올바른 방향으로 설정하고 역방향을 사용하지 않는 것이 좋습니다.

그렇지 않으면 혼동될 수 있습니다. 특히 설정에 기회가 있기 때문에(모든 라인과 표시기에 반대가 적용됨)

 input string    t3= "----- Indicators:        -----" ;               //
input string    short_name                   = "Examples\\MACD" ;   // Name Indicators
input bool      InpIndicators                = false ;             // Indicators: Start (true)
input bool      InpCloseOpposite             = false ;             // Close opposite
input ENUM_TRADE_COMMAND InpTradeCommandY   = open_buy;           // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU   = open_sell;         // Trade command: (SellBuffer Indicators)
input string    t4= "----- Revers Buy><Sell   -----" ;               //
input bool      ObjRevers                    = false ;             //  Revers

코드 자체에서 입력 을 제거하면 됩니다.
이와 같이

 string    t4= "----- Revers Buy><Sell   -----" ;               //
bool      ObjRevers                    = false ;             //  Revers
 
Alexsandr San :

포지션 을 열고 닫는 것을 혼동하지 않도록 모든 라인과 인디케이터를 올바른 방향으로 설정하고 역방향을 사용하지 않는 것이 좋습니다.

그렇지 않으면 혼동될 수 있습니다. 특히 설정에 기회가 있기 때문에(모든 라인과 표시기에 반대가 적용됨)

코드 자체에서 입력 을 제거하면 됩니다.
이와 같이

아니요! 표시기는 반전이 필요합니다

 

나는 더 현명해지고 현명해졌고, 여전히 지표에서 벗어나 새로운 기회를 얻으려고 노력하고 있습니다.

 input string    t3= "----- Indicators: SELL   -----" ;               //
input string    short_name                   = "2" ;               // Name Indicators "SELL"
input bool      InpIndicators                = false ;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY   = open_sell;         // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU   = close_sells;       // Trade command: (SellBuffer Indicators)
input string    t4= "----- Indicators: BUY    -----" ;               //
input string    short_name1                  = "2" ;               // Name Indicators "BUY"
input bool      InpIndicators1               = false ;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY1  = close_buys;         // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU1  = open_buy;           // Trade command: (SellBuffer Indicators)

하나의 표시기와 두 개로 모두 환상을 가질 수 있습니다.

당신은 그것을 집어들 필요가 있습니다, 표시기 - 이와 같이 (사진)

https://www.mql5.com/ru/code/392

스냅 사진

나는 ( 2 )

파일:
2.mq5  17 kb
 
Alexsandr San :

나는 더 현명해지고 현명해졌고, 여전히 지표에서 벗어나 새로운 기회를 얻으려고 노력하고 있습니다.

하나의 표시기와 두 개로 모두 환상을 가질 수 있습니다.

당신은 그것을 집어들 필요가 있습니다, 표시기 - 이와 같이 (사진)

https://www.mql5.com/en/code/392

나는 ( 2 )

1분 동안 어떻게 작동하는지 확인합니다 - 잘 작동합니다

스냅샷2

 
Alexsandr San :

1분 동안 어떻게 작동하는지 확인합니다 - 잘 작동합니다


WWW_Trailing_Line.mq5 가 잘 작동합니다.   96kb , 오류 없음.

정보 및 테스트를 위해 수동 실행의 테스터에 소켓을 추가해야 합니다.

패널

 
Alexsandr San :

WWW_Trailing_Line.mq5 가 잘 작동합니다.   96kb , 오류 없음.

정보 및 테스트를 위해 수동 실행의 테스터에 소켓을 추가해야 합니다.

소켓 추가 - 이제 테스터에서 여전히 손을 채울 수 있습니다.

Command_후행 줄

그의 설정은 무엇입니까

 //+------------------------------------------------------------------+
input string    t= "-----  Parameters         -----" ;               //
input string    Template                     = "ADX" ;             // Имя шаблона(without '.tpl')
input double    TargetProfit                 = 999999.99 ;         // Цель Баланса(Ваш Баланс + сумма)
input uint      maxLimits                    = 1 ;                 // Кол-во Позиции Открыть в одну сторону
input double    InpLots                      = 0.01 ;               // Lots
input int       InpTakeProfit                = 50 ;                 // Take Profit ("0"-No. 5<100)
input string    t0= "----- Trailing Line      -----" ;               //
input string    InpObjUpName                 = "TOP" ;             // Obj: TOP (Horizontal Line)
input ENUM_TRADE_COMMAND InpTradeCommand    = close_sells;       // Obj:  command:
input string    InpObjDownName               = "LOWER" ;           // Obj: LOWER (Horizontal Line)
input ENUM_TRADE_COMMAND InTradeCommand     = close_buys;         // Obj:  command:
input ushort    InpObjTrailingStop           = 30 ;                 // Obj: Trailing Stop (distance from price to object, in pips)
input ushort    InpObjTrailingStep           = 5 ;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)
input string    t1= "----- Line name: 1       -----" ;               //
input string    InpNameR                     = "LineR" ;           // Line name (Horizontal Line or Trend Line)
input ENUM_TRADE_COMMAND InpTradeCommandR   = open_buy;           // Trade command:
input string    t2= "----- Line name: 2       -----" ;               //
input string    InpNameS                     = "LineS" ;           // Line name (Horizontal Line or Trend Line)
input ENUM_TRADE_COMMAND InpTradeCommandS   = open_sell;         // Trade command:
input string    t3= "----- Indicators: SELL   -----" ;               //
input string    short_name                   = "2" ;               // Name Indicators "SELL"
input bool      InpIndicators                = false ;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY   = open_sell;         // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU   = close_sells;       // Trade command: (SellBuffer Indicators)
input string    t4= "----- Indicators: BUY    -----" ;               //
input string    short_name1                  = "2" ;               // Name Indicators "BUY"
input bool      InpIndicators1               = false ;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY1  = close_buys;         // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU1  = open_buy;           // Trade command: (SellBuffer Indicators)
input string    t5= "----- Button:            -----" ;               //
input ENUM_TRADE_COMMAND InpTradeCommandBut = open_buy;           // Obj(BUY):  command:Button: BUY
input ENUM_TRADE_COMMAND InTradeCommandBut  = open_sell;         // Obj(SELL):  command:Button: SELL
input int       TrailingStop_STOP_LEVEL      = 36 ;                 // Button: Trailing Stop LEVEL
파일:
 
Alexsandr San :

소켓 추가 - 이제 테스터에서 손을 채울 수 있습니다.

그의 설정은 무엇입니까

팬케이크! OnDeinit에서 삽입 누락

차트에서 전문가를 삭제하면 패널이 삭제되지 않습니다.

코드가 열려 있으므로 직접 복사하여 붙여넣을 수 있습니다.

 //+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit ( const int reason)
  {
   for ( int i= 0 ; i< ArraySize (_name); i++)
     {
       ObjectDelete ( 0 , Symbol ()+_name[i]);
     };
   EventKillTimer ();
//---
   Print ( TimeCurrent (), ": " , __FUNCTION__ , " reason code = " ,reason);
   Comment ( "" );
  }
//+------------------------------------------------------------------+
 
Alexsandr San :

소켓 추가 - 이제 테스터에서 손을 채울 수 있습니다.

그의 설정은 무엇입니까

기능을 하나 더 추가해야 합니다.

예를 들어 - SELL 시 신호가 발생하여 포지션이 열리지 않았습니다 - 그러나 수평선이 그려지고 N 포인트가 뒤로 돌아갔고 이미 가격이 돌아왔을 때 이 라인에서 포지션이 열렸습니다.

EURUSDH1

 
Alexsandr San :

기능을 하나 더 추가해야 합니다.

예를 들어 - SELL 시 신호가 발생하여 포지션이 열리지 않았습니다 - 그러나 수평선이 그려지고 N 포인트가 뒤로 돌아갔고 이미 가격이 돌아왔을 때 이 라인에서 포지션이 열렸습니다.


무슨 일이 있었던 것 같습니다 - 혼란스럽지 않게 하려고 노력했습니다. 관심 있는 사람이 있으면 물어보십시오. 함께 알아낼 것입니다.

스냅 사진

스냅샷2