Francesco78

Hang seng automatic trend following strategy with volatility filter

Category: Strategies By: Francesco78 Created: January 16, 2019, 1:44 PM
January 16, 2019, 1:44 PM
Strategies
12 Comments
Hang seng automatic trend following strategy with volatility filter

This HangSeng automatic trading strategy on the 1-hour timeframe, uses basic overbought and oversold RSI areas to open new orders and filtered with an average true range volatility filter.

Results attached are from walk forward analysis with 1 OOS period proving robustness of the optimized variables. Variables to be optimized are also described in one of the attached picture.

Discussions about the strategy are running here: Hang seng trend following strategy with volatility filter H1 Time zone : UK

defparam cumulateorders = false

periodrsi = 8
periodatr = 16

a = 30
b = 0.15
timeok = time>20000 and time<120000
oscillator  = rsi[periodrsi](close)
volindic = (averagetruerange[periodatr](close)/close)*100


oversold = oscillator<a and volindic>b and timeok
overbought =oscillator>100-a and volindic>b and timeok

if oversold then
 sellshort 1 contract at market
endif

if overbought then
 buy 1 contract at market
endif

set target pprofit 200
set stop ploss 150

 

Download
Filename: HangSeng-H1-trend-n-volatility.itf
Downloads: 464
Download
Filename: wf_results_1-1.png
Downloads: 261
Download
Filename: wf_HS-1.png
Downloads: 264
Francesco78
Francesco78 Master
As an architect of digital worlds, my own description remains a mystery. Think of me as an undeclared variable, existing somewhere in the code.
Author’s Profile

Comments

debs83
7 years ago
#

Is this strategy standing for DAX please?

Nicolas
7 years ago
#

Title says that it is for Hang Seng

Francesco78
7 years ago
#

@nicola onestamente non ricordo se lo avessi scelto anchored or ananchored.

nicola papangelo
7 years ago
#

Ciao Francesco, il Ts HANG SENG è stato settato con il metodo WalK Forward ? Ancorato o non ancorato ? Grazie

Jan Wind
7 years ago
#

Thanks for the strategy. I have tried your strategy on the DAX for a time frame of 10 minutes, 150.000 bars, give a few trades, too few to say if the profits are robust over time. I will vary and simulate the RSI- and ATR-periods for long and short trades separately. Also I will vary with the trading time, standard it is 24 hrs, maybe it fits better with trading time between 7:00 till 22:00. Thanks again for the strategy. KR JvdW

bloglo110
8 years ago
#

Hi Nicolas, great and thanks for letting me know. :)

bloglo110
8 years ago
#

Hi Francesco, Thanks for your sharing. I am not so familiar with programming, however, I tried to paste the code in Multicharts and error message popped up. ------ Compiled with error(s): ------ syntax error, unexpected 'identificator' line 1, column 9 Possible that I can test this code in Multicharts? Thanks for your time. :)

Nicolas
8 years ago
#

Multicharts? why? Our website is dedicated to programming for ProRealTime: https://www.prorealtime.com

EnJunz
8 years ago
#

Hi Francesco, Seems to work better with tighter stop loss and a trailing stop. Will run this in demo. Thanks for sharing!

FREDNC
8 years ago
#

I graphed volindic with: (averagetruerange[periodatr](close)/close)*100 and ((averagetruerange[periodatr](close))/close)*100 . Addind parenthesis doesn't change anything, Proorder propaly read the code. In a second time, I checked you code on the Dow and it's almost good, just have to addap the range of the WF to find the good optimisation. So, It's a simple code but efficient, nice job and thanks for sharing

Francesco78
8 years ago
#

Hi, no. it means theat it calculates the average true range on the close and then divide by the close. So it is never 1.

FREDNC
8 years ago
#

Hi Francisco, I love the Hangseng for is Volatility and you right to filtering with ATR. But in volindic you write (close)/close) It will always be =1 . mistake ? Missing [1] or something else ?

ProRealCode ProRealCode
Loading...