รบกวน Admin หรือท่านใดก็ได้ครับ แก้ไขอิ้ดี้ตัวนี้ให้นิดนึงครับ
1. เพิ่มขนาดตัวอักษรที่โชว์ในหน้าต่างครับ
2. เพิ่มเสียงเตือนเมื่อเปอร์เซนต์ Diff มากกว่า 50
ขอบคุณมากมายล่วงหน้าครับ
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_level1 20
#property indicator_level2 80
#property indicator_level3 50
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
extern int K = 100;
extern int D = 1;
extern int S = 1;
extern string FirstSymbol = "";
extern string SecondSymbol = "";
double buffer1[], buffer2[];
string m="";
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
m = StringSubstr(Symbol(),6,StringLen(Symbol())-6);
SecondSymbol = SecondSymbol+m;
if (FirstSymbol == "" )
FirstSymbol = Symbol();
else
FirstSymbol = FirstSymbol+m;
//---- indicators
SetIndexBuffer(0,buffer1);
SetIndexStyle(0,DRAW_LINE);
SetIndexLabel(0,FirstSymbol);
SetIndexBuffer(1,buffer2);
SetIndexStyle(1,DRAW_LINE);
SetIndexLabel(1,SecondSymbol);
IndicatorDigits(2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
for(i=limit; i>=0; i--)
{
buffer1
= iStochastic(FirstSymbol,0,K,D,S,0,0,0,i);
buffer2 = iStochastic(SecondSymbol,0,K,D,S,0,0,0,i);
IndicatorShortName("Stochastic ("+K+","+D+","+S+") "+FirstSymbol+" "+SecondSymbol+" Diff: "+DoubleToStr(MathAbs(buffer1-buffer2), 0)+"% ");
}
//----
//----
return(0);
}
//+------------------------------------------------------------------+