I suspect that where you are not seeing arrows that the 2 stochastics have not crossed the level on the same bar, your code requires that they both cross on the same bar. So you need to re-think. Maybe just have 1 cross and the other just be above/below the level.

I surprised that you code runs without an array out of range error.

int limit = rates_total;

int count=prev_calculated;

//Main function

for(int i=limit-count; i>=0;i--)

{

//Getting Stochastic buffer values using the iCustom function

double Stoch1 = iStochastic(NULL,0,KPeriod,DPeriod,Slowing,MODE_SMA,0,MODE_MAIN,i);

double Stoch2 = iStochastic(NULL,0,KPeriod,DPeriod,Slowing,MODE_SMA,0,MODE_MAIN,i+1);

double Stoch3 = iStochastic(NULL,0,KPeriod1,DPeriod1,Slowing1,MODE_SMA,0,MODE_MAIN,i);

double Stoch4 = iStochastic(NULL,0,KPeriod1,DPeriod1,Slowing1,MODE_SMA,0,MODE_MAIN,i+1);

when prev_calculated==0

i=rates_total, whereas the highest bar index will be rates_total-1

then you check i+1, so it should be 2 bars out of range

maybe use something like

int i=prev_calculated>0 ? rates_total-prev_calculated : rates_total-2;

//Main function

for(;i>=0;i--)

hello friends

i m working on double stoch arrow indicator ..two stoch i use 5,3,3 and 14,3,3 logic is when both stoch>50 buy arrow appears if both two stoch<50 sell arrow appear this inidcator works good but missing some arrows please modify and guide me where i m wrong here is code and chart

Files: