본문 바로가기
트레이딩/메타트레이더 코딩

MQL5. 수직선 그리기

by i.got.it 2019. 4. 29.

아래 예와 같은 수직선 그리기. 

 

 

코드. 

int OnInit()
  {
   Init_myLine3(); 
   
   return(INIT_SUCCEEDED);
  }

void OnTick()
{
   MqlRates rates_myCandle[]; 
   ArraySetAsSeries(rates_myCandle,true); // the index = 0 is current candle 
   CopyRates(_Symbol, _Period,0,100,rates_myCandle ); // Copy price data into rates_myCandle[] 

   ObjectMove(_Symbol, "Line3",0,rates_myCandle[99].time,0); // draw line 

}



void Init_myLine3()
{
   ObjectCreate(
            0,  // chart id. 0 means the current chart 
            "Line3",  
            OBJ_VLINE,  
            0, //int sub_window
            0, //datetime time1 
            0 // y value on chart
   ); 
   
   ObjectSetInteger(
            0, // long chart_id
            "Line3",
            OBJPROP_COLOR, //int properti_modifier
            clrWhite       // long value
   );
   
   ObjectSetInteger(0,"Line3",OBJPROP_WIDTH, 10); // line width. 

}

동영상. 

 

 

 

 

 본 글 포함된 상위 정리글

 

메타트레이더5 체계정리  https://igotit.tistory.com/1775

 

 

 


첫등록 : 2019년 4월 29일 

최종수정 : 

 

본 글 단축주소 : https://igotit.tistory.com/2152

 


 

 

'트레이딩 > 메타트레이더 코딩' 카테고리의 다른 글

MQL5. Custom Indicator  (3) 2019.05.10
MQL5. 소켓통신  (0) 2019.05.09
MQL5. 캔들 변경 지점 검출  (0) 2019.04.29
MQL5. 사각형 그리기  (2) 2019.04.29
MQL5. 클래스 만들기  (0) 2019.04.29

댓글



 

비트코인




암호화폐       외환/나스닥/골드       암호화폐/외환/나스닥/골드 암호화폐/외환/나스닥/골드   암호화폐/외환/나스닥/골드
     
현물 |선물 인버스 |선물 USDT       전략매니저(카피트레이딩)     롤오버 이자 없는 스왑프리계좌
( 스왑프리 암호화폐도 거래 가능 )    
MT4, MT5 , cTrader 모두 지원     FTMO 계좌 매매운용. MT4,MT5