@adrinicu
I didn't fully understand you, but start with this:
https://fxdreema.com/shared/TAzsDUI5e
It will buy when price is above previous candle high, and
sell when price is below previous candle low.
You can also change the timeframe.
I'm sad to hear you took losses. Please, take your time to develop your EA, the market will always be there, don't trade before your system is ready đŸ™‚
Make use of the backtest function!