Based on a different behavior of buyers and sellers on monday morning compared to friday evening as a basic approach in a “timebased series”, there is a long positioning on tuesday evening in the Dax.
Below you will find the code for a simple trading system that follows this approach. Similarly, this can already be found in the library as an advertisement for the vtad.
Here, however, it was stated that “buy tuesday evening, sell thursday morning” can be a positive approach, especially if it is underlaid with only 2 simple filters, 1x an EMA filter, 1x a CCI filter.
The result seems impressive.
I wanted to ask if someone could check the code for correctness and if so if someone could check the strategy for a longer distance than the offered 100.000 units.
//-------------------------------------------------------------------------
// Main code : D2 18 1H Long H33
// created and coded by JohnScher
//-------------------------------------------------------------------------
defparam cumulateorders = true
TradingDay = opendayofweek = 2
TradingTime = time = 180000
c1 = close < ExponentialAverage [30] (close)
c2 = cci [24] (close) > -140
Tradebuy = TradingDay and TradingTime and c1 and c2
IF Tradebuy THEN
buy at market
ENDIF
IF onmarket and barindex-tradeindex = 33 then // = D4 040000 notice the asian session
sell at market
Endif
Set Stop %Loss 5
Set Target %Profit 2.5
Thanks John for sharing the idea.
Here is the backtest on 200.000 units with 2 points spread. The robustness test on the 100k out of sample period is a proof of over fitting. You might have made too much optimization of your indicators settings?
Hope you din’t mind John, I couldn’t help wondering what results would look if not Sell after 33 hours (top curve). Food for thought maybe??
What does the version below look like on 200k bars anybody please?
//https://www.prorealcode.com/topic/timebased-series-dax/
//-------------------------------------------------------------------------
// Main code : D2 18 1H Long H33
// created and coded by JohnScher
//-------------------------------------------------------------------------
defparam cumulateorders = False
TradingDay = opendayofweek = 2
TradingTime = time = 170000
//
c1 = close < ExponentialAverage [30] (close)
c2 = cci [24] (close) > -150 //-140
Tradebuy = c1 and c2 and TradingDay and TradingTime
IF Tradebuy THEN
buy at market
SET STOP PLOSS 350
SET TARGET PPROFIT 425
ENDIF
//IF onmarket and barindex-tradeindex = 33 then // = D4 040000 notice the asian session
//sell at market
//Endif
//Set Stop %Loss 5
//Set Target %Profit 2.5
Here’s with 200,000,
A drawdown from a heart attack …..
Thank You @Mauro for the 200k results.
Weird that your equity curve shows losses / reducing equity for most of 2018 whereas my equity curve during 2018 showed small gains?
Hello and a big thanks!
The topic that concerns me are the time-based trades due to the different behavior of the investors. If I determine this behavior I try to improve the result with simple filters. Overoptimization is to be avoided.
Unfortunately the mentioned 200.000 K are missing to check my theory.
So once again a big thank you to you.