ALE

CSR strategy DAX 1 D

Category: Strategies By: ALE Created: May 19, 2017, 7:20 AM
May 19, 2017, 7:20 AM
Strategies
18 Comments
CSR strategy DAX 1 D

This automated trading strategy was posted by Nicolas 1 year ago for long side trade as example, starting from this example I’ve added short side, Trailing stop, and Donchian stop.

Below you will find link of the original version: “Cumulative RSI 2 periods strategy”.

The following variables can be optimized and  adapted to volatily and time frame

Trailing Stop : TGL and TGS

Stop loss by Donchian channel: DC

Moving Average: AVG to open position above or below it

Period of cumulative summ of the RSI indicator value “CUMRSI”

Positions are opens at indicator value set, called “CUMRSI” , this could be optimized and  adapted to volatily and time frame (Ex:IF Close>AVG AND CUMRSI<35  THEN BUY…)

The concept of the strategy it’s universal, and It could work for equity/indices/currencies.

This strategy could be used with cumulative order for long side. Below the result in the red graphic equity.

https://www.prorealcode.com/prorealtime-trading-strategies/cumulative-rsi-2-periods-strategy/

//CSR strategy cumulative 2 periods
//Author Nicolas 2016 - February
//Optimizator Ale 2017 - May
// cfd DAX 1 Daily
// Spread 5 - 95% of Position open at 010000 am
// Probacktest 10 years Tick by Tick

DEFPARAM CumulateOrders = FALSE // Posizioni cumulate disattivate
//indicator
Period = 2
CUMRSI = SUMMATION[Period](RSI[Period](close))
AVG = average[100](close)
AVGS = average[110](close)
//initial lot
initLOT = 1
 
//initial lot
initLOT = 1
CUM=COUNTOFLONGSHARES<4
IF  Close>AVG AND CUMRSI<35 AND CUM THEN
 BUY initLOT CONTRACTS AT MARKET
ENDIF
 
If LongOnMarket AND CUMRSI>65THEN
 SELL AT MARKET
ENDIF
IF  NOT SHORTONMARKET AND Close<AVGS AND CUMRSI > 175 THEN
 SELLSHORT initLOT CONTRACTS AT MARKET
ENDIF
 
If SHORTONMARKET AND CUMRSI<120 THEN
 EXITSHORT AT MARKET
ENDIF
//TRAILING STOP
TGL=25
TGS=15
if not onmarket then
 MAXPRICE = 0
 MINPRICE = close
 PREZZOUSCITA = 0
ENDIF
if longonmarket then
 MAXPRICE = MAX(MAXPRICE,close)
 if MAXPRICE-tradeprice(1)>=TGL*pointsize then
  PREZZOUSCITA = MAXPRICE-TGL*pointsize
 ENDIF
ENDIF
if shortonmarket then
 MINPRICE = MIN(MINPRICE,close)
 if tradeprice(1)-MINPRICE>=TGS*pointsize then
  PREZZOUSCITA = MINPRICE+TGS*pointsize
 ENDIF
ENDIF
if onmarket and PREZZOUSCITA>0 then
 EXITSHORT AT PREZZOUSCITA STOP
 SELL AT PREZZOUSCITA STOP
ENDIF

// DONCHIAN STOP
once DC =25
IF LONGONMARKET THEN
 DC=40
ENDIF
IF SHORTONMARKET THEN
 DC=30
ENDIF
e= Highest[DC](high)
f=Lowest[DC](low)
if longonmarket  then
 laststop = f[1]
endif
if shortonmarket  then
 laststop = e[1]
endif
if onmarket then
 sell at laststop stop
 exitshort at laststop stop
endif

 

Download
Filename: CSR-strategy-DAX-1-D-2.itf
Downloads: 1295
Download
Filename: CSR-strategy-DAX-1-D.jpeg
Downloads: 735
ALE
ALE Master
My name is Alessandro, i'm a trader since 2006 You can find me on my website: <a href="http://www.automatictrading.it/" rel="dofollow">www.automatictrading.it</a> <strong>(trading programming services Italy)</strong> Italy
Author’s Profile

Comments

Azzuerus
1 year ago
#

Is there a ProRealCode indicator behind this strategy?

crazytrader
7 years ago
#

Is this working?

Jesper
8 years ago
#

I tried it on dax 1D and I did not get any trades. Shifted to 10H and it started working. Would you have any idea on why that is?

rgrgrgr
7 years ago
#

I have the same problem

StefanStrand
9 years ago
#

I tried running this on IG ProRealTime and get the following error message, why could this be? Total beginner, sorry :-) "Your ProBacktest exceeds the limit of repetitions for walk forward optimization." Any idea how I can fix this?

Toto le Heros
9 years ago
#

It looks very interresting. I have one question related to the following result in ProbackTest with Spread=5 on DAXmini 1 EUR CFD (tick bt tick "on") : - if the period of the test is from 01/01/2013 00:00 to 01/03/2013 00:00, the Long trade taken on 6/02/2013 01:00 ends on 10/02/2013 21:00 with -13.30€ (loss) - if the period of the test is from 01/02/2013 00:00 to 01/03/2013 00:00, the Long trade taken on 6/02/2013 01:00 ends on 07/02/2013 01:00 with -73.80€ (loss) Does that mean that in that code, the previous trade taken in January 2013 (on the 17th) affects the behaviour of the code in February 2013 ? Or what ?... I am actually asking the question as in general I am wondering if it is better to : - let the code run by prolongating the period of activity of the strategy in PRT (but isn't there a risk here that after a certain number of executions, the code automatically stops ?) - or to stop and start again the code from time to time (for example, each month) Many thanks in advance for your comments/answers. BR,

Nicolas
9 years ago
#

The code has been updated in the attachment of the post with the last version which contain the fix. So you can download it here to get the good version too.

ALE
ALE
9 years ago
#

Thanks as always Nicolas

ALE
ALE
9 years ago
#

Hello Guys
I'm trying to fix a problem that I missed during the probacktest, I update you as soon as possible on the topic

ALE
ALE
9 years ago
#

www.prorealcode.com/topic/csr-strategy/

ALE
ALE
9 years ago
#

Hello Guys,
I've starting new topic

Thanks for your attention,  we can help each other  always

 

Cosmic1
9 years ago
#

Hi Ale, good work. The RSI 2 periods is one of my favourites and I too modified and added some variables to my liking from the original. I run it on the S+P and it works well. I notice that you ran multiple passes for WF. With such limited trades, I'd be interested in the results from a standard one pass 70/30. What do you think?

ALE
ALE
9 years ago
#

Hi cosmic

I'm study this indicator just in these days.. I hope to discover some of interesting !! I've starting a topic for further discussion, if you know well please suggest!!

GraHal
9 years ago
#

Wow this looks good! Thank you so much Ale for sharing!

Yes, please open a Forum Thread for tests / discussion etc with a link from here.

Best Regards
GraHal

ALE
ALE
9 years ago
#

You can start with round value of the variables mentioned above... value as you know for each market

Francesco78
9 years ago
#

Sounds good! pls indicate the  variables to be optimized so that we can speed it up :)

Ciao

Francesco78
9 years ago
#

Thank you Ale, did you try it with othere indices other than the DAX? 

 

ALE
ALE
9 years ago
#

Hi francesco

 not yet, I have given a look..it seems that there are good possibilities with different markets I would open a topic so that we post our tests

ProRealCode ProRealCode
Loading...