Moving average trading system

Category: Strategies By: Matriciel Created: September 27, 2016, 3:25 PM
September 27, 2016, 3:25 PM
Strategies
17 Comments

EN / Hello everyone,

Here is an automatic trading strategy based on the Mobile Averages.

This code is very simple because I started in this discipline! 🙂

I need your help to optimize the code. I would like to filter out false signals in order to have more winning positions and reduce drawdown.

Thank you in advance for your help.

Best regards,

DJ

 

FR / Bonjour à tous,

Voici une stratégie de trading automatique basée sur les Moyennes Mobiles.

Ce code est très simple car je débute dans cette discipline ! 🙂

Je sollicite votre aide afin d’optimiser ce code. J’aimerais filtrer les faux signaux afin d’avoir davantage de positions gagnantes et réduire le drawdown.

Merci d’avance pour votre aide.

Bien cordialement,

DJ


// Définition des paramètres du code
DEFPARAM CumulateOrders = True // Cumul des positions activé

// Conditions pour ouvrir une position acheteuse
indicator1 = close
indicator2 = Average[100](close)*1.002
c1 = (indicator1 CROSSES OVER indicator2)

indicator3 = close
indicator4 = Average[1000](close)
c2 = (indicator3 > indicator4)

IF c1 AND c2 THEN
BUY 1 CONTRACT AT MARKET
ENDIF

// Conditions pour fermer une position acheteuse
indicator5 = close
indicator6 = Average[100](close)*0.998
c3 = (indicator5 CROSSES UNDER indicator6)

IF c3 THEN
SELL  AT MARKET
ENDIF

// Conditions pour ouvrir une position en vente à découvert
indicator7 = close
indicator8 = Average[100](close)*0.998
c4 = (indicator7 CROSSES UNDER indicator8)

indicator9 = close
indicator10 = Average[1000](close)
c5 = (indicator9 < indicator10)

IF c4 AND c5 THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF

// Conditions pour fermer une position en vente à découvert
indicator11 = close
indicator12 = Average[100](close)*1.002
c6 = (indicator11 CROSSES OVER indicator12)

IF c6 THEN
EXITSHORT  AT MARKET
ENDIF

Download
Filename: Moving-Average-TS-Matriciel.itf
Downloads: 419
Matriciel Master
Currently debugging life, so my bio is on hold. Check back after the next commit for an update.
Author’s Profile

Comments

Logo Logo
Loading...