だから私はいくつかのコーディングを行い、空のバッファを持っています。EMPTY_BUFFERをどのように感じるかを尋ねたいので、IF行== EMPTY BUFFERを使用する場合は、それを埋めてください..私はすでにいくつかのコーディングを試していますが、まだ空のバッファを埋めていません
#property strict
#property indicator_level1 75.0
#property indicator_level2 25.0
#property indicator_levelcolor LimeGreen
#property indicator_levelwidth 1
#property indicator_levelstyle 0
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 Blue
#property indicator_color4 Green
#property indicator_color5 Red
extern string howtouse= "scalping in m5";
extern string contact = "reiz_gamer@yahoo.co.id";
extern string created = "created by reza rahmad";
extern int barsToProcess=100;
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double buy[];
double sell[];
int values;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(3,DRAW_NONE);
SetIndexBuffer(3,buy);
SetIndexEmptyValue(3,0.0);
SetIndexStyle(4,DRAW_ARROW,EMPTY,3,Magenta);
SetIndexArrow(4,234);
SetIndexBuffer(4,sell);
SetIndexEmptyValue(4,0.0);
// initialization of the generator of random numbers
ObjectCreate("sig",OBJ_TEXT,0,0,0,0,0);
ObjectSetText("sig","TAHAN",10,"Times New Roman",Magenta);
ObjectCreate("sig1",OBJ_LABEL,0,0,0,0,0);
ObjectSet("sig1",OBJPROP_XDISTANCE,750);
ObjectSet("sig1",OBJPROP_YDISTANCE,20);
ObjectSetText("sig1","created by reza rahmad scalping use in tf 5m",10,"Times New Roman",Magenta);
//---
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("tare");
ObjectDelete("tarmid");
ObjectDelete("tare1");
ObjectDelete("sig");
ObjectDelete("sig1");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted(),
limit;
if(counted_bars>0)
counted_bars--;
limit=Bars-counted_bars;
if(limit>barsToProcess)
limit=barsToProcess;
for(int i=0;i<limit;i++)
{
double main5 = iStochastic( NULL, PERIOD_M5, 14, 3, 3, MODE_SMMA, 0, MODE_MAIN, i );
double signal5 = iStochastic( NULL, PERIOD_M5, 14, 3, 3, MODE_SMMA, 0, MODE_SIGNAL, i );
double ma20 = iMA( NULL, PERIOD_M5, 20, 0, MODE_SMA, PRICE_CLOSE, 0 );
double ma5 = iMA( NULL, PERIOD_M5, 5, 0, MODE_SMA, PRICE_CLOSE, 0 );
ExtMapBuffer1[i] = EMPTY_VALUE;
ExtMapBuffer2[i] = EMPTY_VALUE;
if ( main5 > signal5
&& High[0] > ma5
){
ExtMapBuffer1[i] = ( ( Close[i+1] + Close[i] ) / 2 );
values = 1;
}
if ( main5 < signal5
&& Low[0] < ma5
){
ExtMapBuffer2[i] = ( ( Close[i+1] + Close[i] ) / 2 );
values = 2;
}