I can try. I’m just guessing the signal would come too early.
JSParticipant
Senior
A very useful fast MA is the Hull MA…
For the time being I decided for a simple MACD pullback. I already use this system to success in the M1 time frame. I have simplified it something and transformed to 10 seconds. It is important to know, I like to use standard parameters. Simply here SMA20 and SMA200 and MACD. I have added an ADX in standard size. So should not be over-optimized. If one takes TP / SL away, it is also positive. Unfortunately, I can only for 7 days, but that does not even look so bad.
German time
SP500
Spread = 0.6
TF 10Seconds
What do you think? Does anyone have 1000000 bars for testing?
@Grahal @nonethleess: What does the expert eye say?
//================================================
DEFPARAM CUMULATEORDERS = false
defparam preloadbars = 10000
//Risk Management
PositionSize=5
timeframe(1minute, updateonclose)
MAM51 = Average[20,0](close)
MAM52 = Average[200,0](close)
mylongM5 = MAM51 > MAM52
myshortM5 = MAM51 < MAM52
myADX = ADX[14] > 20
timeframe(default)
MAM1 = Average[1,0](close)
mylongM1orig = MAM1 > Average[200,0](close)
myshortM1orig = MAM1 < Average[200,0](close)
MACDLinie = MACDline[12,26,9](close) > 0
MACDCross = MACD[12,26,9](close) crosses over 0
MACDLinieshort = MACDline[12,26,9](close) < 0
MACDCrossshort = MACD[12,26,9](close) crosses under 0
// trading window
ONCE BuyTime = 120000 //080000
ONCE SellTime = 210000
// position management
IF Time >= BuyTime AND Time <= SellTime THEN
If MACDCross and MACDLinieshort and mylongM1orig and mylongM5 and myADX Then //and myADX
Buy PositionSize CONTRACTS AT MARKET
SET STOP %LOSS 0.5
SET TARGET %PROFIT 0.8
ENDIF
If MACDCrossshort and MACDLinie and myshortM1orig and myshortM5 and myADX Then //and myADX
sellshort PositionSize CONTRACTS AT MARKET
SET STOP %LOSS 0.5
SET TARGET %PROFIT 0.8
ENDIF
endif
if longonmarket and myshortM5 then
sell at market
endif
if shortonmarket and mylongM5 then
exitshort at market
endif
here’s the 1m bar BT in UK open hours (143000 – 210000), spread = 0.4
At a quick glance, i’d say this line looks wrong:
MAM1 = Average[1,0](close)
SMA with a period of 1 … is that what you wanted?
Can you please test again over the same time and comment on SL and TP before?
SMA with 1 period is the same as “Close”.
please test again over the same time
i did that already, it’s a bust – loss of e700 in 6 months. It at least turns a profit in open hours but needs more work.
Damned. It would have been too easy.
Would this variant be better? My short back test period says SP500, NASDAQ and DAX positive results. Can you check that again?
Run either for 10 seconds or 30 seconds.
//================================================
DEFPARAM CUMULATEORDERS = false
defparam preloadbars = 10000
//Risk Management
PositionSize=5
////myATR = AverageTrueRange[14](close)
timeframe(1minute, updateonclose)
MAM51 = Average[20,0](close)
MAM52 = Average[200,0](close)
mylongM5 = MAM51 > MAM52
myshortM5 = MAM51 < MAM52
timeframe(default)
MAM11 = Average[20,0](close)
MAM12 = Average[200,0](close)
mylongM1orig = MAM11 crosses under MAM12
myshortM1orig = MAM11 crosses over MAM12
// trading window
ONCE BuyTime = 120000 //080000
ONCE SellTime = 210000
// position management
IF Time >= BuyTime AND Time <= SellTime THEN
If mylongM1orig and mylongM5 Then //and mylongM5
Buy PositionSize CONTRACTS AT MARKET
//SET STOP %LOSS hl //0.8
//SET TARGET %PROFIT gl //1
ENDIF
If myshortM1orig and myshortM5 Then //and mylongM5
sellshort PositionSize CONTRACTS AT MARKET
//SET STOP %LOSS hs //0.8
//SET TARGET %PROFIT gs //1
ENDIF
endif
if longonmarket and myshortM5 then //or myshortM1orig
sell at market
endif
if shortonmarket and mylongM5 then //or mylongM1orig
exitshort at market
endif
sorry but it only gets worse, 10s or 30s
If you’ve only got 200k to play with I think it’s better to stay with TFs that give you a decent amount of data, 5min and above
I’m putting this ever so slightly forked version (TP & SL only) on Forward Test today!
DAX 3 sec spread = 1
Keep ’em coming phoentzs , thank you for sharing!
@Grahal: Will you tell me which version or post the code?
When I think about it … does it make sense to optimize over 1000000bars in such a short time frame? The basic message that your test shows is that the system has been positive for half a year. And that the system had major problems in November and earned nothing for a month. So November market conditions are not a good fit for this system. Since this system lives from longer, short-term daily trends, despite the short time frame, the problem could perhaps be remedied with a trailing stop. And as luck would have it, one is already running in my demo … I’ll post the results tomorrow morning.
(maybe this post is not much useful)
When I think about it … does it make sense to optimize over 1000000bars in such a short time frame?
But of course it does (I wish I had 10M bars for my s1 TF). And maybe this even especially applies to the shorter TimeFrames; the more situations you run into (with good overall result) the better it is – it shows you the resilience of your system. So maybe it is not about optimizing as such but merely about checking what happens underway – you actually tell the same ?
The basic message that your test shows is that the system has been positive for half a year. And that the system had major problems in November and earned nothing for a month. So November market conditions are not a good fit for this system.
If November market conditions are not good for your system, you may be broke with it started on November 1 by accident. This is how I declare “resilience”. It should cover for all and be independent of marker conditions. This is how the system becomes a “technical” thing (I think you will recall that I name my systems “technical” as such).
With the (way) longer TimeFrames, you will make yourself dependent on market conditions you don’t even know yet. Thus, supposed your system makes profit only when it runs for two years, how will you ever be able to deal with the drawdowns ? If you money-wise can, you still can’t psychologically. This may work for Stocks, but not for what most are attempting (Futures). At least that is how I think it is. 😉
Below you see my DAX (manual trading). This is for a reason. Why would my autotrading be longer term ? Hence, how to – at times – perform several trades per hour (most out of defense) if the TF is H1 or even more ?
I cannot say exactly why I am suddenly building a system in the range of seconds … more normally I take signals from the H4 chart and evaluate them in the M1 … M15. Well, exactly this system works for me in the M1 with amazing results. Quite stable in several indices. I have been handling this system manually in the S10 or M1 for a few weeks in order to discover errors. I’ve usually always been a breakout trader, but it seems to me that pullbacks are even better for me. And this type of system is nothing else. You never stop learning in your life. For years I have tried to develop systems in the forex market with rather modest success. If I had concentrated more on indices.