Limit Stochastic indicator only on 1st trade

 

I would like to use this stochastic only on first trade with Starting_Lot.

int Buy_Okk=0;
int Sell_Okk=0;
if(Stochastic_Filter_Enable==true)

 double Stochatic=iStochastic(Symbol(),0,K_Period,D_Period,Slowing,0,StrToDouble(Price_Field),0,1);
 if(Stochatic<=Buy_Level)
  Buy_Okk=1; 
 if(Stochatic>=Sell_Level)
 Sell_Okk=1; 
}
else
{

 Buy_Okk=1;
 Sell_Okk=1;
}

 
redcode:

I would like to use this stochastic only on first trade with Starting_Lot.

<CODE REMOVED>

Please edit your post . . . 


Please use this to post code . . . it makes it easier to read.

 
redcode:

I would like to use this stochastic only on first trade with Starting_Lot. 

Please edit your post . . . 

 read and see MESSAGE RaptorUK 

 

So that means you do have use it only when the first open trade of your strategy has not been starten yet

Means you have to change the line

if(Stochastic_Filter_Enable==true)

 For a line that gives the condition if the first open trade of your strategy has not been starten

Simple to do, for someone who does know how to count the open trades of the EA that is working