코딩 도움말 - 페이지 667

 
이 EMA 크로스오버를 EA로 바꾸는 데 도움을 줄 사람이 필요합니다. 파란색 화살표가 나타나면 매수를 열고 빨간색 화살표가 나타나면 매도 화살표 옆에 있는 양초가 닫히면 거래를 종료합니다. pls는 SL 및 TP를 조정 가능하고 MA를 허용합니다. 촛불을 거래하는 데 사용하고 싶습니다.
 
dotmund :
이 EMA 크로스오버를 EA로 바꾸는 데 도움을 줄 사람이 필요합니다. 파란색 화살표가 나타나면 매수를 열고 빨간색 화살표가 나타나면 매도 화살표 옆에 있는 양초가 닫히면 거래를 종료합니다. pls는 SL 및 TP를 조정 가능하고 MA를 허용합니다. 촛불을 거래하는 데 사용하고 싶습니다.
이 게시물을 확인하십시오 : https://www.mql5.com/en/forum/180648/page940
 
mladen :

캔들 타임의 경우, 그에 특화된 인디케이터를 사용하는 것이 가장 좋습니다(첨부된 것과 같은).

마침표 구분 기호는 이미 nmc이지만 첨부된 것을 사용하고 싶을 수도 있습니다(cpu에서 더 가벼워야 함).

매우 감사합니다. " BarsLimit " 옵션추가 하려고 하는데 성공 하지 못했습니다 . 도와주시겠어요? 시간 내 주셔서 정말 감사합니다.
 
Entropy :
매우 감사합니다. " BarsLimit " 옵션추가 하려고 하는데 성공 하지 못했습니다 . 도와주시겠어요? 시간 내 주셔서 정말 감사합니다.

엔트로피

다음은 해당 옵션이 추가된 버전입니다.

파일:
 

안녕하세요 mladen은 선언을 해결하는 방법을 가르쳐 줄 수 있습니다.

이것이 내가 경고를 받는 것입니다.

declaration of 'MinLots' hides global declaration at line 93    
declaration of 'MaxLots' hides global declaration at line 94    
declaration of 'Magic' hides global declaration at line 118     
void CalculateMM()
{
   double MinLots= MarketInfo ( Symbol (), MODE_MINLOT );
   double MaxLots= MarketInfo ( Symbol (), MODE_MAXLOT );
   Lots= AccountFreeMargin ()/ 100000 *RiskPercent;
   Lots= MathMin (MaxLots, MathMax (MinLots,Lots));
   if (MinLots< 0.1 )Lots= NormalizeDouble (Lots, 2 );
   else
   {
     if (MinLots< 1 )Lots= NormalizeDouble (Lots, 1 );
     else Lots= NormalizeDouble (Lots, 0 );
   }
   if (Lots<MinLots)Lots=MinLots;
   if (Lots>MaxLots)Lots=MaxLots;
   return ;



int CloseBuyOrders( int Magic)
{
   int total= OrdersTotal ();

   for ( int cnt=total- 1 ;cnt>= 0 ;cnt--)
  {
     if ( OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES )) 
     if ( OrderMagicNumber ()==Magic&& OrderSymbol ()== Symbol ())
    {
       if ( OrderType ()== OP_BUY )
      {
       ClTicket= OrderClose ( OrderTicket (), OrderLots (), Bid , 3 );
      }
    }
  }
   return ( 0 );
}

int CloseBuyOrdersHiddenTP( int Magic)
{
   int total= OrdersTotal ();

   for ( int cnt=total- 1 ;cnt>= 0 ;cnt--)
  {
     if ( OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES )) 
     if ( OrderMagicNumber ()==Magic&& OrderSymbol ()== Symbol ())
    {
       if ( OrderType ()== OP_BUY && Bid >( OrderOpenPrice ()+TakeProfit* Point ))
      {
        ClTicket= OrderClose ( OrderTicket (), OrderLots (), Bid , 3 );
      }
    }
  }
   return ( 0 );
}

고맙습니다 .

 
stevenpun :

안녕하세요 mladen은 선언을 해결하는 방법을 가르쳐 줄 수 있습니다.

이것이 내가 경고를 받는 것입니다.



고맙습니다 .

먼저 이것 :

 void CalculateMM()
{
   double tMinLots= MarketInfo ( Symbol (), MODE_MINLOT );
   double tMaxLots= MarketInfo ( Symbol (), MODE_MAXLOT );
   Lots= AccountFreeMargin ()/ 100000 *RiskPercent;
   Lots= MathMin (tMaxLots, MathMax (tMinLots,Lots));
   if (tMinLots< 0.1 )Lots= NormalizeDouble (Lots, 2 );
   else
   {
     if (tMinLots< 1 )Lots= NormalizeDouble (Lots, 1 );
     else Lots= NormalizeDouble (Lots, 0 );
   }
   if (Lots<tMinLots)Lots=tMinLots;
   if (Lots>tMaxLots)Lots=tMaxLots;
   return ;

 int CloseBuyOrders( int tMagic)
{
   int total= OrdersTotal ();

   for ( int cnt=total- 1 ;cnt>= 0 ;cnt--)
  {
     if ( OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES )) 
     if ( OrderMagicNumber ()==tMagic&& OrderSymbol ()== Symbol ())
    {
       if ( OrderType ()== OP_BUY )
      {
       ClTicket= OrderClose ( OrderTicket (), OrderLots (), Bid , 3 );
      }
    }
  }
   return ( 0 );
}

int CloseBuyOrdersHiddenTP( int tMagic)
{
   int total= OrdersTotal ();

   for ( int cnt=total- 1 ;cnt>= 0 ;cnt--)
  {
     if ( OrderSelect (cnt, SELECT_BY_POS , MODE_TRADES )) 
     if ( OrderMagicNumber ()==tMagic&& OrderSymbol ()== Symbol ())
    {
       if ( OrderType ()== OP_BUY && Bid >( OrderOpenPrice ()+TakeProfit* Point ))
      {
        ClTicket= OrderClose ( OrderTicket (), OrderLots (), Bid , 3 );
      }
    }
  }
   return ( 0 );
}
 

안녕하세요 믈라덴입니다.

수정해야 할 사항에 대해 이 코드를 알려 주시겠습니까?

또한 더 높은 기간이 되면 다음에서 변경할 수 있습니까?

===> 1분 ~ 30분 ==> 10핍마다

===> 1시간 ======> 50핍마다

===> 4시간, 매일 ======> 100핍마다

===> 주간, 월간 ===> 1000핍마다

선 대신 직사각형이 필요합니다.

#속성 표시기_차트_창

#define ONDA_BEGINS 0

#define ONDA_CONTAINS 1



//+----------------------------------------------- -------------------+

//| 커스텀 인디케이터 초기화 기능 |

//+----------------------------------------------- -------------------+

정수 초기화()

{

//---- 표시기


//----

리턴(0);

}

//+----------------------------------------------- -------------------+

//| 커스텀 인디케이터 초기화 해제 기능 |

//+----------------------------------------------- -------------------+

정수 초기화()

{

//----

for (int ix = 0; ix < nLines; ix++) // 수평선 삭제

{

ObjectDelete("tensLines"+ix);

}


//----

리턴(0);

}

//+----------------------------------------------- -------------------+

//| 사용자 지정 표시기 반복 기능 |

//+----------------------------------------------- -------------------+

정수 시작()

{

int nLines = 40; // 그릴 총 라인 수

이중 라인 간격 = 0.0010; // 줄 사이의 간격

이중 표준 가격 = NormalizeDouble(닫기[1],3); // 현재 가격은 가장 가까운 "10"으로 반올림됩니다.


for (int ix = 0; ix < nLines; ix++) // 루프 스팬 횟수

{

if(ObjectFind("tensLines"+ix) < 0)

ObjectCreate("tensLines"+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); // 현재 가격의 반은 위, 반은 아래에 놓습니다.


else ObjectSet("tensLines"+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval));

ObjectSet("tensLines"+ix,OBJPROP_COLOR,DarkSlateGray); // 라인을 더 보기 좋게 만듭니다.

}

//----

리턴(0);

}

//+----------------------------------------------- -------------------+


void ObjectNameDeleteAll(문자열 이름, int where=ONDA_BEGINS, int 유형=EMPTY)

{

for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--)

{

문자열 켜기 = ObjectName(iObj);

int iPos = StringFind(on, 이름);

if (iPos < 0) 계속

if (iPos > 0 && where == ONDA_BEGINS) 계속;

if (유형 == EMPTY) ObjectDelete(on);

else if (유형 == ObjectType(on)) ObjectDelete(on);

}

}




//---

 
murnathan32 :

안녕하세요 믈라덴입니다.

수정해야 할 사항에 대해 이 코드를 알려 주시겠습니까?

또한 더 높은 기간이 되면 다음에서 변경할 수 있습니까?

===> 1분 ~ 30분 ==> 10핍마다

===> 1시간 ======> 50핍마다

===> 4시간, 매일 ======> 100핍마다

===> 주간, 월간 ===> 1000핍마다

선 대신 직사각형이 필요합니다.

#속성 표시기_차트_창

#define ONDA_BEGINS 0

#define ONDA_CONTAINS 1



//+----------------------------------------------- -------------------+

//| 커스텀 인디케이터 초기화 기능 |

//+----------------------------------------------- -------------------+

정수 초기화()

{

//---- 표시기


//----

리턴(0);

}

//+----------------------------------------------- -------------------+

//| 커스텀 인디케이터 초기화 해제 기능 |

//+----------------------------------------------- -------------------+

정수 초기화()

{

//----

for (int ix = 0; ix < nLines; ix++) // 수평선 삭제

{

ObjectDelete("tensLines"+ix);

}


//----

리턴(0);

}

//+----------------------------------------------- -------------------+

//| 사용자 지정 표시기 반복 기능 |

//+----------------------------------------------- -------------------+

정수 시작()

{

int nLines = 40; // 그릴 총 라인 수

이중 라인 간격 = 0.0010; // 줄 사이의 간격

이중 표준 가격 = NormalizeDouble(닫기[1],3); // 현재 가격은 가장 가까운 "10"으로 반올림됩니다.


for (int ix = 0; ix < nLines; ix++) // 루프 스팬 횟수

{

if(ObjectFind("tensLines"+ix) < 0)

ObjectCreate("tensLines"+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval)); // 현재 가격의 반은 위, 반은 아래에 놓습니다.


else ObjectSet("tensLines"+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval));

ObjectSet("tensLines"+ix,OBJPROP_COLOR,DarkSlateGray); // 라인을 더 보기 좋게 만듭니다.

}

//----

리턴(0);

}

//+----------------------------------------------- -------------------+


void ObjectNameDeleteAll(문자열 이름, int where=ONDA_BEGINS, int 유형=EMPTY)

{

for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--)

{

문자열 켜기 = ObjectName(iObj);

int iPos = StringFind(on, 이름);

if (iPos < 0) 계속

if (iPos > 0 && where == ONDA_BEGINS) 계속;

if (유형 == EMPTY) ObjectDelete(on);

else if (유형 == ObjectType(on)) ObjectDelete(on);

}

}




//---

이렇게 시도

 #property indicator_chart_window

#define ONDA_BEGINS   0

#define ONDA_CONTAINS 1


     int nLines = 40 ;                                   // Number of total line to draw

//+------------------------------------------------------------------+

//| Custom indicator initialization function                         |

//+------------------------------------------------------------------+

int init()

  {

//---- indicators


//----

   return ( 0 );

  }

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function                       |

//+------------------------------------------------------------------+

int deinit()

  {

//----

     for ( int ix = 0 ; ix < nLines; ix++) // delete my horizontal lines

      {

       ObjectDelete ( "tensLines" +ix);

      }


//----

   return ( 0 );

  }

//+------------------------------------------------------------------+

//| Custom indicator iteration function                              |

//+------------------------------------------------------------------+

int start()

  {


   double lineInterval = 0.0010 ;                       // Interval between lines

   double normPrice = NormalizeDouble ( Close [ 1 ], 3 );     // Current price is rounded to nearest "10"


   for ( int ix = 0 ; ix < nLines; ix++)                 // Loop span number of times

      {

       if ( ObjectFind ( "tensLines" +ix) < 0 ) 

         ObjectCreate ( "tensLines" +ix, OBJ_HLINE , 0 , 0 , normPrice+((ix-(nLines/ 2 ))*lineInterval));     // Place half above and half below the current price


       else ObjectSet ( "tensLines" +ix, OBJPROP_PRICE1 , normPrice+((ix-(nLines/ 2 ))*lineInterval));

       ObjectSet ( "tensLines" +ix, OBJPROP_COLOR ,DarkSlateGray);       // Make the lines look better

      }

 

//----

   return ( 0 );

  }

//+------------------------------------------------------------------+


void ObjectNameDeleteAll( string name, int where=ONDA_BEGINS, int type= EMPTY )

{

     for ( int iObj= ObjectsTotal ()- 1 ; iObj >= 0 ; iObj--)

    {

         string on   = ObjectName (iObj);

         int     iPos = StringFind (on, name);

         if (iPos < 0 )                         continue ;

         if (iPos > 0 && where == ONDA_BEGINS) continue ;

         if       (type == EMPTY )         ObjectDelete (on);

         else if (type == ObjectType (on)) ObjectDelete (on);

    }

}



 
안녕하세요 여러분, 저를 위해 파이썬으로 코드를 작성해 줄 누군가를 고용하려고 합니다. 누군가의 일에 대해 기꺼이 비용을 지불하거나 누군가가 무료로 그것을 해준다면 그것도 좋습니다. 그러나 언제든지 저에게 돌아와서 누군가 저를 도울 수 있는지 알려주십시오. 누군가의 관심을 받으면 더 자세히 설명하겠습니다. 그것은 주로 몇 가지 다른 지표와 함께 볼린저 밴드 에 있을 것입니다. 모든 도움 주셔서 감사합니다!
 
mladen :

이렇게 시도

우와. 당신은 남자입니다. 축복해주셔서 감사합니다.

하나 더 요청합니다. 아래 첨부/그림과 같이 격자를 직사각형으로 만들 수 있습니까? 예를 들어 직사각형당 10핍. 직사각형이 미래를 투영 하게 하십시오.

기본 격자보다 눈에 더 쉽게 느껴집니다. 그리고 보고 있는 핍의 움직임을 확인하는 데 0.5초가 걸립니다.

     ObjectCreate ( "Rect02" , OBJ_RECTANGLE , 0 , Time[0] , Bid, Time[ Bars ], (Bid+ 0.0010 ) ); //make bar above cur price
      ObjectSet( "Rect02" , OBJPROP_COLOR , Silver );
      }
//================= Move the Rect with new ticks/candles ===========================
   
   else {
       ObjectMove ( "Rect01" , 0 , Time[ 0 ], WindowPriceMin()* 0.95 );
       ObjectMove ( "Rect02" , 0 , Time[ 0 ], Bid); 

}

파일: