"FTSE is lying" strategy discussion
Forums › ProRealTime English forum › ProOrder support › "FTSE is lying" strategy discussion
- This topic has 12 replies, 4 voices, and was last updated 7 years ago by Nicolas.
-
-
05/09/2017 at 1:06 PM #34932
@GDKLockout (thank you and welcome) posted a strategy to the library here. Unfortunately the back test did not take spread into account so ignore the equity curve.
I’ve started a topic on this here in case the system has some potential once coded properly; was hoping to get a few ideas going.
Here’s a basic framework to get started on. There are pretty much no filters, no funky stop or limit mechanisms; just variable optimization work. Separated long and short components into different optimizations. Spread set to 1.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364// ATR based Reversion// Maz @ prorealcode.com | GDKLockout @ prorealcode.com// Questions: prtmaz at gmail dot com// Version 0.22DEFPARAM CumulateOrders = FalseDEFPARAM FLATBEFORE = 080000DEFPARAM FLATAFTER = 210000// Constantsonce positionSize = 1once optimization = 1// Variable optimization setsif optimization = 1 then // FTSE M39startTime = 080000endTime = 210000tradingTime = time >= startTime and time < endTimeatrPeriodLong = 13 //12atrPeriodShort = 20 //12atrMultipleLong = 2atrMultipleShort = 2rangeWinMultLong = 1.6 // 2.5rangeWinMultShort = 2.1 // 2.5elsif optimization = 2 thenendif// -- Indicators & functions -----upBar = close > opendnBar = close < openbodyRange = abs(open-close)atrLong = AverageTrueRange[atrPeriodLong]atrThreshLong = (atrLong * atrMultipleLong)barAtThreshLong = bodyRange > atrThreshLongatrShort = AverageTrueRange[atrPeriodShort]atrThreshShort = (atrShort * atrMultipleShort)barAtThreshShort = bodyRange > atrThreshShort// -- Entry Condition logic -----bc = tradingTimebc = bc and barAtThreshLong and dnBarsc = tradingTimesc = sc and barAtThreshShort and upBar// -- Execution logic -----if bc thenbuy positionSize shares at marketSET STOP pLOSS bodyRangebcTarget = (bodyRange*rangeWinMultLong)*pipsizeSET TARGET pPROFIT bcTargetelsif sc thensellshort positionSize shares at marketSET STOP pLOSS bodyRangescTarget = (bodyRange*rangeWinMultShort)*pipsizeSET TARGET pPROFIT scTargetendifITF attached
Let’s get filtering 🙂
1 user thanked author for this post.
05/09/2017 at 1:56 PM #34944Hi Maz,
Thank you so much for your interest and effort in helping with this.
I can explain the theory behind how I traded this strategy manually if you think it would help. I wasn’t using any indicators at all and just introduced the atr as a measurement for the purpose of trying to automate this. I also used my own support and resistance lines as confirmation, but have no idea how to write this into the code.
Just to note: In my back test i did set the spread to 1, I just double checked this too.
I was wondering if you could please explain the following bits of code in layman’s terms to help me under stand the changes you made, I will explain what i think you mean.
123atrPeriodLong <span class="token operator">=</span> <span class="token number">13</span> <span class="token comment" spellcheck="true">//12</span>atrPeriodShort <span class="token operator">=</span> <span class="token number">20</span> <span class="token comment" spellcheck="true">//12</span>Do you mean you have adjusted the strategy to have a atr of 13 for longs and 20 for shorts instead of the 12 standard?
rangeWinMultLong = 1.6 // 2.5
rangeWinMultShort = 2.1 // 2.5Again is this an adjustment to the targets instead of my 2.5*body?
Is the above two examples of optimization, as in playing around with the numbers to get better results?
bcTarget = (bodyRange*rangeWinMultLong)*pipsize
what does the *pipsize part do here?
thanks in advance, and I apologize for what must seem like infantile questions.
Regards
GDK
05/09/2017 at 2:24 PM #34947Hi,
Apologies on the spread comment. My mistake.
To answer your questions in order: yes, yes and yes. You are correct on all. “*pipsize” takes care of those who are quoted a pip with sizes other than 1
Please could you elaborate on what support/resistance lines you were looking at and what the rules around them were? State the rules in English and I’ll see if I can take care of the code.
05/09/2017 at 3:54 PM #34949Hi.
Please see the two screen shots of my current support and resistance levels. ( 1hour chart show action to the right of the vertical line) They are extreme points marked out on the 4 hour and 1 hour charts that mark levels of interest for the big players. ( i treat them more like bands 30 pips or so wide but use lines for clean charts). The Yellow one is the marker for trend reversal and would be used with extreme caution.
I have found that when price action accelerates towards and through these points a reversal is likely. See marked the trades I would have taken on the 1 hour chart. I look for a deceleration after the support or resistance level on the 5 min chart for my entry point.
the stop loss will be the same size as the leading candle length on the 30 min chart and I will move my stop loss to break even at around 20 pips profit, however this is more a money management technique and is a trade off of draw down over potential profit, i will often re enter the same trade again. and I am willing to give up this for an automated system.
As you can see its not fool proof but the winners are considerably bigger than the losers. On my spread sheet of real trades I have 68% winning trades at 3.81:1 RR over the last 4 years I have been doing this. with little variation from quarter to quarter.
1 user thanked author for this post.
05/09/2017 at 4:00 PM #34954Just again, its the previous strength of the reversals that take place at these levels that determine the support and resistance.
05/09/2017 at 4:09 PM #34956I aos would like to note that in trying to explain the philosophy behind the system i have realized how subjective a lot of it is, It is incredible difficult to to definitively explain my years of intuitive learning from studying the charts.
05/09/2017 at 4:41 PM #34958Hello and thank you for pointing out this strategy.
As I noticed that conceptually is very similar to the work we are doing on the DAX discussed here:
I tried to introduce a filter based on the ADX indicator.
As the strategy is mean reverting I have introduced a new variable for short and longs, called adxmax and added the condition that for the trade ADX has to be lower than adxmax.
Pls find attached the results. No big changes, but a slightly better equity curve.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172// ATR based Reversion// Maz @ prorealcode.com | GDKLockout @ prorealcode.com// Questions: prtmaz at gmail dot com// Version 0.22DEFPARAM CumulateOrders = FalseDEFPARAM FLATBEFORE = 080000DEFPARAM FLATAFTER = 210000// Constantsonce positionSize = 1once optimization = 1// Variable optimization setsif optimization = 1 then // FTSE M39startTime = 080000endTime = 210000tradingTime = time >= startTime and time < endTimeadxperiodlong = 18adxperiodshort = 18adxmaxlong = 26adxmaxshort = 40atrPeriodLong = 13 //12atrPeriodShort = 20 //12atrMultipleLong = 2atrMultipleShort = 2rangeWinMultLong = 1.6 // 2.5rangeWinMultShort = 2.1 // 2.5elsif optimization = 2 thenendif// -- Indicators & functions -----upBar = close > opendnBar = close < openbodyRange = abs(open-close)adxlong = adx[adxperiodlong]adxshort = adx[adxperiodshort]atrLong = AverageTrueRange[atrPeriodLong]atrThreshLong = (atrLong * atrMultipleLong)barAtThreshLong = bodyRange > atrThreshLongatrShort = AverageTrueRange[atrPeriodShort]atrThreshShort = (atrShort * atrMultipleShort)barAtThreshShort = bodyRange > atrThreshShortmeanrevertinglong = adxlong < adxmaxlongmeanrevertingshort = adxshort <adxmaxshort// -- Entry Condition logic -----bc = tradingTimebc = bc and barAtThreshLong and dnBarbc = bc and meanrevertinglongsc = tradingTimesc = sc and barAtThreshShort and upBarsc = sc and meanrevertingshort// -- Execution logic -----if bc thenbuy positionSize shares at marketSET STOP pLOSS bodyRangebcTarget = (bodyRange*rangeWinMultLong)*pipsizeSET TARGET pPROFIT bcTargetelsif sc thensellshort positionSize shares at marketSET STOP pLOSS bodyRangescTarget = (bodyRange*rangeWinMultShort)*pipsizeSET TARGET pPROFIT scTargetendifLet me know what you think
Regards
Francesco
05/09/2017 at 5:09 PM #34961Hi Francesco,
Yes it was reading that Dax break out strategy that prompted me to try code my one. I has always gone by the moto ” the Dax breaks and the Fste fakes”
1 user thanked author for this post.
05/09/2017 at 5:15 PM #34962ahah sounds appropriate 🙂 I wonder if with some optimized parameter we could profit also from a Ftse brake and a Dax fake. Have you ever tried?
05/09/2017 at 5:28 PM #34965Im not sure i understand what you mean?
I think you mean that they break and fake in tandem, at the same time? No i have never tried this.
05/09/2017 at 5:32 PM #34966No I just meant to code a breakout strategy for Ftse100 that goes together with a your mean reverting strategy.
Basically the same I did for the Dax in the discussion I posted above.
As you see I included and ADX filter in your original code in order not to take mean reverting position when there is a more or less defined trend.
SO basically we could try to include also a breakout strategy in your code when the ADX is greater then a certain threshold.
05/09/2017 at 5:41 PM #34967ah Ok, I have a bit more learning to do on the ADX indicator before I can comment on that. I am really happy for your input and look forward to grinding out some variables tomorrow.
1 user thanked author for this post.
05/10/2017 at 10:27 AM #35026I aos would like to note that in trying to explain the philosophy behind the system i have realized how subjective a lot of it is
Finding the same levels that you find easily by looking at the graphics will be a real challenge 🙂
Maybe you could help, please review this support resistance indicator on a price chart to see if it has any similarity to the way you are drawing these levels (this one only find support lines currently).
-
AuthorPosts
Find exclusive trading pro-tools on