Analyse X last bars, need help please :)

 

Hy there,

Firstly, I d like to apologise formy bad english skills:(, I promise I ll try to do my best :)

 

Indicators : EMA5 - EMA30 - EMA100

     CCI 12

Graph : Candles

TF : all

 

Why I need help, and What I need in my code for my indicator, thanks to your help:) : 

Buy Signal :

1. CCI cross UP -100

2. Prices are above EMA100

3. On the last X candles (for example 5 last candles excepted the current one, so shift =1 I guess ?), Signal is valide if on the x last candles, none crossed down EMA100 (Open and Close should be above EMA100, no matter if low crossed this ema100)

Sell Signal :

1. CCI cross DOWN 100

2. Prices are under EMA100

3. On the last X candles (for example 5 last candles excepted the current one, so shift =1 I guess ?), Signal is valide if on the x last candles, none crossed upEMA100 (Open and Close should be under EMA100 for the last X candles (here 5 last candles)), no matter if low crossed this ema100)

 

Don t hesitate if it s not clear as it should be :)

 

Thanks for help,

 

Have a good day :)

 

Soukenson

 

A precision, I don t know how to code the last X candles, with X as an extern variable :)

I try to do a boucle with for, but unsuccessfull :(

 

Thanks again :)

 

soukenson 

 

Hello,


Nobody ? :(


Have good Sunday to you all :)


Soukenson

 
try to google for for what you want amend the closest version..
 

Thanks 

Reason: