Friends, I made a system using Donchian Channel. The start of the code is simply the Donchian Formula:
periods = Optimize("Periods", 20, 0, 45, 5);
DHigh = HHV(Ref(H,-1),periods);
DLow = LLV(Ref(L,-1),periods);
DMiddle = (DHigh+DLow)/2;
After this, I begin my for loop code, and all the signals (buy, sell, stoploss, profit, breakeven) is made via this for loop.
My database is in 1m. When I backtest in 1m (settings > periodicity), it works just fine, the exactly way it should. But when I set a different time frame to my backtest, it returns messed results.
What am I doing wrong?
Thanks, friends!
periods = Optimize("Periods", 20, 0, 45, 5);
DHigh = HHV(Ref(H,-1),periods);
DLow = LLV(Ref(L,-1),periods);
DMiddle = (DHigh+DLow)/2;
After this, I begin my for loop code, and all the signals (buy, sell, stoploss, profit, breakeven) is made via this for loop.
My database is in 1m. When I backtest in 1m (settings > periodicity), it works just fine, the exactly way it should. But when I set a different time frame to my backtest, it returns messed results.
What am I doing wrong?
Thanks, friends!