BUY and SELL immediatly

 

Hello, 

I join you the code of a simple DEMA strategy. Problem is: it closes and open trades immediatly on the same candle... What is the mistake I am doing ? 


Thanks a lot

Files: