[ARCHIVE!] 포럼을 어지럽히 지 않도록 초보자 질문. 프로, 놓치지 마세요. 너 없이는 아무데도 - 4. - 페이지 64

 
alsu :
번거롭게 터미널을 들여다보면 RSI "코드 형태"가 표준 패키지에 들어 있습니다.
없으시다면 여기에 보관하세요.
파일:
rsi.mq4  3 kb
 

MetaTrader4에서 메뉴를 수정하는 방법은 무엇입니까? 때로는 화면 전체에 공포를 퍼뜨립니다. 글쎄, Windows의 작업 표시줄이 고정되어 있기 때문에 Windows도 여기에 고정되어 있습니까?

 

안녕하세요 말씀해주세요

지금이 코드가 있습니다.

         if (M_1<NizUroven && M_0 >=NizUroven)
                {
 for ( int i= OrdersTotal ()- 1 ;i>= 0 ;i--)
   if ( OrderSelect (i,SELECT_BY_POS,MODE_TRADES))
     {     CloseOrder();
     }
   Lot2=GetLot(MaxRisk);
NewOrder(OP_SELL,Lot2);
}


             if (M_1>VerhUroven && M_0<=VerhUroven)
               {
 for ( int j= OrdersTotal ()- 1 ;j>= 0 ;j--)
   if ( OrderSelect (j,SELECT_BY_POS,MODE_TRADES))
     {    CloseOrder();
     }
Lot2=GetLot(MaxRisk);
 NewOrder(OP_BUY,Lot2);
}



이런 식으로 단순화하는 방법?

 for ( int i= OrdersTotal ()- 1 ;i>= 0 ;i--)
   if ( OrderSelect (i,SELECT_BY_POS,MODE_TRADES))
     {     CloseOrder(); 
     }
   Lot2=GetLot(MaxRisk);

         if (M_1<NizUroven && M_0 >=NizUroven) 
                { NewOrder(OP_SELL,Lot2);
}
             if (M_1>VerhUroven && M_0<=VerhUroven)
               {  NewOrder(OP_BUY,Lot2);
}

 

그리고 또 다른 질문은, 6개월 동안 최적화를 했고, 그런 결과를 얻었습니다. 왜 많은 패스에 0이 있는지(트랜잭션이 없었는지) 명확하지 않습니까?

 
monopolie :

MetaTrader4에서 메뉴를 수정하는 방법은 무엇입니까? 때로는 화면 전체에 공포를 퍼뜨립니다. 글쎄, 작업 표시줄은 Windows에서 고정되어 있기 때문에 여기에서도 Windows가 고정되어 있습니까?

버그가 아니라 기능이라고 함))
 
monopolie :

MetaTrader4에서 메뉴를 수정하는 방법은 무엇입니까? 때로는 화면 전체에 공포를 퍼뜨립니다. 글쎄, Windows의 작업 표시줄이 고정되어 있기 때문에 Windows도 여기에 고정되어 있습니까?


메뉴 - "열 자동 크기 조정" 항목을 마우스 오른쪽 버튼으로 클릭하고 원하는 대로 이동합니다.
 
griha :

안녕하세요 말씀해주세요

지금이 코드가 있습니다.



이런 식으로 단순화하는 방법?


이 부분:

 for ( int j= OrdersTotal ()- 1 ;j>= 0 ;j--)
   if ( OrderSelect (j,SELECT_BY_POS,MODE_TRADES))
     {    CloseOrder();
     }
Lot2=GetLot(MaxRisk);
 NewOrder(OP_BUY,Lot2);

함수에 넣어:

ff( int cmd)
{
   for ( int j= OrdersTotal ()- 1 ;j>= 0 ;j--)
       if ( OrderSelect (j,SELECT_BY_POS,MODE_TRADES))
      {
         CloseOrder();
      }
   double Lot2=GetLot(MaxRisk);
   NewOrder(cmd,Lot2);
}

그리고 더:

 if (M_1<NizUroven && M_0 >=NizUroven)
{
   ff(OP_SELL);
}

if (M_1>VerhUroven && M_0<=VerhUroven)
{
   ff(OP_BUY);
}

이것은 가시성을 사용하거나 MaxRisk 변수를 함수에 전달하는 예입니다. 직접 알아낼 것입니다.

 
안녕하세요!
특정(사용자 지정) 주문 을 여는 문제가 발생했습니다.
이 문제를 해결해야 할 작은 코드를 작성하고 해결하는 것처럼 보이지만 순간이 있습니다.
임의의 수의 주문이 열릴 때 일반적으로 테스트가 끝날 때입니다.

아래는 코드 자체입니다.

 extern string Kolichestvo_orderov = "Количество единовременно открытых ордеров" ;
extern int OrederBuy = 1 ;
extern int OrederSell = 1 ;


int OrdS= 1 ,OrdB= 1 ,ticketBuy,ticketSell,lastticketSell= 0 ,lastticketBuy= 0 ;

//========================================================================================================//     
                                  //---- Открытие ордеров SELL ----//
//========================================================================================================//

if (OrdS<=OrederSell)
  { //----- start
 
if (trendDn==true && SthFast> 88.2 && SthSlow< 38.2 )
     {
ticketSell= OrderSend ( Symbol (),OP_SELL, 0.1 ,Bid, 3 , 0 , 0 , 0 ,magick, 0 , Blue );OrdS++; //--- Если ордер открыт параметр OrdS увеличиваю 
     }
   } //-----end
          
//========================================================================================================//  
                                    //----Открытие ордеров BUY ----//
//========================================================================================================//  

if (OrdB<=OrederBuy)
  { //-----start

if (trendUp==true && SthFast< 11.8 && SthSlow> 61.8 )
      {
ticketBuy= OrderSend ( Symbol (),OP_BUY, 0.1 ,Ask, 3 , 0 , 0 , 0 ,magick, 0 , Red );OrdB++; //--- Если ордер открыт параметр OrdB увеличиваю
      }

  } //------end
  

//------------------------------- Подсчет количества ордеров BUY & SELL ----------------------------------//
   
   if (ticketBuy<= OrdersHistoryTotal ()) //------ проверка тикетов тех  ордеров которые уже закрыты
   {
   for ( int ordBuy=lastticketBuy;ordBuy<= OrdersHistoryTotal ();ordBuy++) //--- перебор новых закрытых ордеров
    {
     if ( OrderSelect (ordBuy,SELECT_BY_POS,MODE_HISTORY)==true){ if ( OrderType ()==OP_BUY)OrdB--;lastticketBuy=ticketBuy;} //--- если добавился новый закрытый ордер бай, то параметр OrdB уменьшаю
    }
   }
  
   //-----
    
 if (ticketSell<= OrdersHistoryTotal ()) //------ проверка тикетов тех  ордеров которые уже закрыты
  {
 for ( int ordSell=lastticketSell;ordSell<= OrdersHistoryTotal ();ordSell++) //--- перебор новых закрытых ордеров
     {
     if ( OrderSelect (ordSell,SELECT_BY_POS,MODE_HISTORY)==true){ if ( OrderType ()==OP_SELL)OrdS--;lastticketSell=ticketSell;}  //--- если добавился новый закрытый ордер селл, то параметр OrdS уменьшаю

문제에 대한 더 간단한 해결책이 있다면 기꺼이 댓글을 달겠습니다.

 

안녕하세요!

다음과 같이 차트에 텍스트를 표시할 수 있는지 알려주실 수 있습니까?

   string mytext = " Hello from programmer! ";
   ObjectSetText("mycomment", mytext, 10, "Arial", Gray);
     if (ObjectFind("mycomment") == -1) {
         ObjectCreate("mycomment", OBJ_LABEL, 0, 0, 0);
         ObjectSet("mycomment", OBJPROP_CORNER, 2);
         ObjectSet("mycomment", OBJPROP_XDISTANCE, 5);
         ObjectSet("mycomment", OBJPROP_YDISTANCE, 7);}

다음과 같이 호출할 수 있도록 별도의 함수로 출력합니다.

 mycomment( "Hello from programmer!" )