Hello everyone
Ive been off sick from work for a few weeks and decided to tinker with my old trading accounts again. To my surprise I was doing pretty well Intraday trading the FTSE 100 on the 5 minute period.
However I can’t stay sick forever so I thought I’d open a prt account from my IGindex account and have a go at automating my strategy. But……sweet mother of god I no longer know the woods from the trees! I’ve only been using their simple, wisiwig, version but it’s proving too hard to understand if I am accurately reflecting my trading strategy on prt. I have a feeling I’m not and get distracted by backtesting stochastic strategies, listening to 6 music, checking my emails and wondering how many cups of tea it’s possible to drink in one day.
Any how, what I’m after is some help. I’m happy to explain my strategy if you guys can code it and maybe with the community advice and tweaking we can come up with something worth having.
Looking forward to the brainathon!
graham
Hi Gmanicus
Welcome to the forum.
If you post the rules of your strategy. We would be more than happy to help you code it.
We can create a new forum thread and get the community involved.
Hi Stanton
Thanks for the welcome and for the offer of help. Im not really sure where best to post my strategy for now so will post it here and take your lead as to where best to post it.
So, my strategy is this.
Instrument: FTSE100 (5 minute period)
Indicators: Bollinger (20,2), EMA(26), EMA(14), EMA(6), CCI(14) and Stochastic(14,3,3)
Strategy: Basically the strategy is follows the price action over the mid bollinger line and the trade is placed after the first price to cross the mid bollinger line open and closes either above or below it.
Rules for long trades: 1. CCI moving upwards crossing 0 and or between 0 and 100. 2. Stochastic moving upwards crossing 40 and or between 40 and 80 (preferably previous 3 periods showing the K line crossing over the D line and remaining above it in the current period.). 3. A previous alignment of Mid Bol below 26 EMA, 14 EMA below Mid Bol and 6 EMA below 14 EMA. 4. 1st period price action open and close below Mid Bol, 2nd period price action open below Mid Bol and Close above, 3rd period price action opens and close above the Mid Bol – Close triggers the trade. (the 2nd period doesn’t have to span the Mid Bol as long as there is a strong movement up towards the mid bol and the next period price action opens and closes above the mid bol.)
Rules for short trades: Reverse above 🙂
I do use a more simplistic version whereby i just pay attention to the price action, mid bol and the stochastic.
Stop: 10
Target: 8 ( It is possible to get much more out of the movement than this but my greedy desires have often left me counting my loses so i tend to stick to 8)
Time: Because of the spreads and volatility i only trade between the FTSE opening times – 08:00 to 16:30
Ok, so that is the jist of it and i hope its clear enough to code from. Any way i would appreciate your thoughts and feelings!
All the best
Graham
Hi Graham
Took a stab at it results are not great maybe you can see if i went wrong somewhere.
icci=CCI[14](typicalPrice)
midband = Average[20](close)
stochrsi = Stochastic[14,3](Close)
ema26 = ExponentialAverage[26](close)
ema14 = ExponentialAverage[14](close)
ema6 = ExponentialAverage[6](close)
c1 = icci crosses over 0
c2 = stochrsi crosses over 40
c3 = ema26 > midband
c4 = ema14 < midband
c5 = ema14 > ema6
c6 = open[2] < midband and close[2] < midband and open[1] < midband and close[1]> midband and open > midband and close > midband
LongConditions = c1 and c2 and c3 and c4 and c5 and c6
IF NOT LongOnMarket AND LongConditions THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
c7 = icci crosses under 0
c8 = stochrsi crosses under 40
c9 = ema26 < midband
c10 = ema14 > midband
c11 = ema14 < ema6
c12 = open[2] > midband and close[2] > midband and open[1] > midband and close[1] < midband and open < midband and close < midband
ShortConditions = c7 and c8 and c9 and c10 and c11 and c12
//// Conditions to enter short positions
IF NOT ShortOnMarket AND ShortConditions THEN
SELLSHORT 1 CONTRACTS AT MARKET
ENDIF
set stop ploss 10
set target pprofit 8
Added date range
DEFPARAM CumulateOrders = False
DEFPARAM FLATBEFORE = 080000
DEFPARAM FLATAFTER = 163000
icci=CCI[14](typicalPrice)
midband = Average[20](close)
stochrsi = Stochastic[14,3](Close)
ema26 = ExponentialAverage[26](close)
ema14 = ExponentialAverage[14](close)
ema6 = ExponentialAverage[6](close)
c1 = icci crosses over 0
c2 = stochrsi crosses over 40
c3 = ema26 > midband
c4 = ema14 < midband
c5 = ema14 > ema6
c6 = open[2] < midband and close[2] < midband and open[1] < midband and close[1]> midband and open > midband and close > midband
LongConditions = c1 and c2 and c3 and c4 and c5 and c6
IF NOT LongOnMarket AND LongConditions THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
c7 = icci crosses under 0
c8 = stochrsi crosses under 40
c9 = ema26 < midband
c10 = ema14 > midband
c11 = ema14 < ema6
c12 = open[2] > midband and close[2] > midband and open[1] > midband and close[1] < midband and open < midband and close < midband
ShortConditions = c7 and c8 and c9 and c10 and c11 and c12
//// Conditions to enter short positions
IF NOT ShortOnMarket AND ShortConditions THEN
SELLSHORT 1 CONTRACTS AT MARKET
ENDIF
set stop ploss 10
set target pprofit 8
This is great thanks so much for doing this Stanton. Theres something not quite right with it but at least it gives me something to work with in learning the code.