I like the ProRealCode community very much – so many ideas and solved problems!
Now, this is my first post of a strategy I developed long ago, when I still worked with MetaStock. Programming in Prorealtime is much more comfortable. Im not a master-programmer but I like to share my idea here:
The idea is that after a bearish phase the market makes it often the other way round and we can cut a little piece out of this “swing back”. But the swing back has to reach a certain level. I know this is a kind of Fibo-Trading, but I divided the downtrend with help of the donchian channel into 4 sections. The first section is the bottom, the second and the third are in the middle and the fourth is the top.
When the market crosses from the first to second section we go long. Target could be the level from second to third section. Sometimes you can risk more… This is the variable “zl” in the code.
In addition to the first signal the standard macd has to show an upwards trend.
Also I added a very, very light progression in it. I know – things like martingale always lead to a catastrophe. But I think at certain winning rate it can “help” a little bit – its a limited progression. The progression can also be sharpened or smoothed with the “ff”-variable.
The starting ordersize “os” can be adapted to your account. An ordersize of 1 makes a drawdown of 293,- Euro, what is acceptable while gaining 3400,-. For me a draw down of 1/10 of the win is very acceptable. The maximum os is 7 in this case.
Increasing the ordersize to 3 makes a dd of 1022, while gaining 10600. Maximum os is 21.
Please feel free to change, prove and test the code….
Thanks for any responses….
// Quadranten-System DAX 5 min // only long
once os=3 // ordersize - can be any number depending on account size.
once kax=15 //15
once teilung=1.5 //1.5 reducing the ordersize after winning trade
once zl=2 // 2 Ziellevel. Quadrant wird in zl Teile geteilt, je weniger, desto höher das Ziel
once mgr=60 // 40 Mindestgröße des Channels
once ff=2.5 //2.5 increasing ordersize after losing trade.
once maxcon=ff*ff*os+os// defing the maximum ordersize
if hour=8 and minute>45 then // default setting of parameters outside tradingtime
if strategyprofit>sp then // and if equity reaches maximum again.
if date<>20161226 and date <>20161227 and date<>20161230 and hour>8 then // there may be more "bad"-days to be excluded..... not only christmas
if strategyprofit<strategyprofit then // increasing ordersize when losing
if os>maxcon then
if strategyprofit>strategyprofit then // decreasing ordersize when winning
if os<osa then
ma= macd[12,26,9] // standard....
if not onmarket and start=0 then // defining the trading channel (Donchian)
diff=hh-ll // range of the channel
elonglinie=ll+diff/4 // defining the entryline by dividing the channel into 4 Quadrants. Entryline is the first line above the bottom
// (above the lower band of donchian channel)
ziellong=ll+diff/zl // defining the target line. zl: a variable to play with.....
elong=diff>mgr and close<elonglinie and ma<ma// entry signal: minimum range of donchian, close below entry line and
///macd must move upwards.
if elong then
buy os contract at elonglinie stop //
sell at ziellong limit // target
sell at ll stop // lower band of donchian = stop exit
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.ProRealTime ITF files and other attachments :