#property version"1.00"#property indicator_chart_window#property indicator_buffers4#property indicator_plots2#property indicator_type1 DRAW_COLOR_ARROW#property indicator_width1 1#property indicator_color1 clrRed,clrGray#property indicator_type2 DRAW_COLOR_ARROW#property indicator_width2 1#property indicator_color2 clrGreen,clrYellowint arrowDistance=10;
double b1[];
double b1c[];
double b2[];
double b2c[];
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit()
{
//--- indicator buffers mappingSetIndexBuffer(0,b1,INDICATOR_DATA);
SetIndexBuffer(1,b1c,INDICATOR_COLOR_INDEX);
// PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_ARROW);PlotIndexSetInteger(0,PLOT_ARROW,234);
PlotIndexSetInteger(0,PLOT_ARROW_SHIFT,-arrowDistance);
PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0);
SetIndexBuffer(2,b2,INDICATOR_DATA);
SetIndexBuffer(3,b2c,INDICATOR_COLOR_INDEX);
//PlotIndexSetInteger(2,PLOT_DRAW_TYPE,DRAW_COLOR_ARROW);PlotIndexSetInteger(2,PLOT_ARROW,233);
PlotIndexSetInteger(2,PLOT_ARROW_SHIFT,arrowDistance);
//---return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constdatetime &time[],
constdouble &open[],
constdouble &high[],
constdouble &low[],
constdouble &close[],
constlong &tick_volume[],
constlong &volume[],
constint &spread[])
{
//---int first;
if(prev_calculated>rates_total || prev_calculated<=0) // checking for the first start of the indicator calculation
{
first=0; // starting index for calculation of all bars
}
else first=prev_calculated-1;
for(int i=first;i<rates_total&&!IsStopped();i++)
{
b1[i]=high[i];
if(open[i]>close[i]) b1c[i]=0.0;
else b1c[i]=1.0;
b2[i]=low[i];
if (open[i]>open[i+1]) b2c[i]=0;
else b2c[i]=1.0;
}
//--- return value of prev_calculated for next callreturn(rates_total);
}
//+------------------------------------------------------------------+
Hello,
I am trying to create a simple indicator , which assign 2 different type of graphical arrows (each graphical arrow can be assigned one of 2 colors based on certain conditions in the code) on each candle on chart . However the second graphical arrow should be looking as an " arrow up", however a "small circle" is drawn instead, and i don't know the reason why the arrow code = 233 is not taken in use. The colors of the second graphical arrow is fine.
Hello,
I am trying to create a simple indicator , which assign 2 different type of graphical arrows (each graphical arrow can be assigned one of 2 colors based on certain conditions in the code) on each candle on chart . However the second graphical arrow should be looking as an " arrow up", however a "small circle" is drawn instead, and i don't know the reason why the arrow code = 233 is not taken in use. The colors of the second graphical arrow is fine.
Can someone help please?