Author: Copyright (c) 2010, Fai Software Corp.
nyoron
0 Views
0 Downloads
0 Favorites
nyoron
//+------------------------------------------------------------------+
//|                                                       nyoron.mq4 |
//|                           Copyright (c) 2010, Fai Software Corp. |
//|                                    http://d.hatena.ne.jp/fai_fx/ |
//+------------------------------------------------------------------+
#property copyright "Copyright (c) 2010, Fai Software Corp."
#property link      "http://d.hatena.ne.jp/fai_fx/"

#property indicator_chart_window
// http://useyan.x0.com/s/html/mono-font.htm “™•ƒtƒHƒ“ƒg‚Ì—á
extern string FontName = "‚l‚r ‚oƒSƒVƒbƒN";  //"‚l‚r ƒSƒVƒbƒN"@"‚l‚r –¾’©" "HGs‘‘Ì" "GungsuhChe"
extern color  FontColor = White; 
extern int    FontSize = 12;   
extern int    LineSpace = 4;//sŠÔ

extern int    XShift = 350;//ƒIƒuƒWƒFƒNƒgŒQ‚̍¶‘¤ƒXƒy[ƒX
extern int    YShift = 10;//ƒIƒuƒWƒFƒNƒgŒQ‚̏㑤ƒXƒy[ƒX

extern int    BlockShift = 0;// 60•¶Žš–ˆ‚̃uƒƒbƒN‚Ì”z’uƒYƒŒ’²®—p

// OS ‚É‚æ‚Á‚Ä60•¶ŽšƒuƒƒbƒN‚̃TƒCƒY‚ªˆá‚¤‚̂ŗv’ˆÓB
// ƒtƒHƒ“ƒgƒTƒCƒY 7`18 ‚ð‘z’èB

// for Vista
//int BlockSize[] = {0,1,2,3,4,5,6,360,420,480,480,540,600,660,720,780,780,840,900};

// for WindowsXP
int BlockSize[] = {0,1,2,3,4,5,6,300/*7*/,300,300,420/*10*/,420,480,540,540/*14*/,600,660,660,720/*18*/};

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   if(FontSize > 18 ) FontSize = 18;
   if(FontSize <  7 ) FontSize =  7;
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   DelObj();
   Comment("");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
string msg = 
"@@@@@@@@@@ @ -] 'LPPMR¤"+"\n"+
"@@ @ @ @ @ @ ^@^\" MR R@@_"+"\n"+
"@@@@@@@@@//, '/@@@@ RÊ @¤@R"+"\n"+
"@@@@@@@@ V {_{@@@ @@@Ø| ‚Œ.„  i| @‚É"+"\n"+
"@@@@@@@@ Ú!¬‚Œƒm@@@ MR ˜¸@|Ai|@@‚å"+"\n"+
"@@@@@@@ @ R|l@œ@@@œ@ |@.|Ʉ @ ‚ë"+"\n"+
"@ @ @ @@@@@ |́½ ¤_,¤_,¼½j @|@, |.@@l"+"\n"+
"@@@@@@@@@@|@/Ül,¤ __,@ƒCƒ@ƒg |/ |@ ‚ñ"+"\n"+
".@@@@@@@@@ | /@ /::|ŽO/::/^@ R |"+"\n"+
"@@@@@@@@@ | |@@l SÉ:::/ ƒq::::œc, |";

CommentOBJ(msg);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
// ‰üs‚Å‹æØ‚Á‚ďˆ—‚·‚éB
string CommentOBJ(string msg){
   DelObj();
   int start = 0;
   int i = 0;
   msg = msg + "\n";
   string msg_unit;
   while(i<500){  // 500sˆÈ‰º‚ð‘z’è
      int n = StringFind(msg,"\n",start);
      if(n!=-1){
         if(n-start > 0){
            msg_unit = StringSubstr(msg,start, n-start);
         }else{
            msg_unit =" ";
         }
         start = n+1;
         //Print(start," ",n," ",msg_unit);
         DrawTXTLine("TXT-"+i,msg_unit,XShift,YShift+i*FontSize+i*LineSpace);
      }else{
         break;
      }
      i++;
   }
}
//+------------------------------------------------------------------+
// TXT- ‚ÅŽn‚Ü‚éƒIƒuƒWƒFƒNƒg‚ð‘Síœ‚·‚é
void DelObj(){
   string objname;
   for(int i=ObjectsTotal();i>=0;i--){
      objname = ObjectName(i);
      if( StringFind(objname,"TXT-")>=0) ObjectDelete(objname);
   }
}
//+------------------------------------------------------------------+
// 60•¶Žš–ˆ‚É‹æØ‚Á‚ă‰ƒxƒ‹ƒIƒuƒWƒFƒNƒg‚ðì¬‚·‚éB
void DrawTXTLine(string objname, string msg, int X, int Y)   
{   
   int len = StringLen(msg);
   for(int i=0;i*60<len;i++){
      string submsg = StringSubstr(msg,60*i,60);
      ObjectCreate(objname+i,OBJ_LABEL,0,0,0);   
      ObjectSet(objname+i,OBJPROP_XDISTANCE, X+(BlockSize[FontSize]+BlockShift)*i);   
      ObjectSet(objname+i,OBJPROP_YDISTANCE, Y);  
      ObjectSetText(objname+i,submsg,FontSize,FontName,FontColor);   
   }
}  
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---