SP500 - riding the trend

Category: Strategies By: JR1976 Created: September 4, 2017, 4:54 PM
September 4, 2017, 4:54 PM
Strategies
16 Comments

 

Simple strategy on S&P500 with “controlled” averaging down orders. Strategy has stoploss (100 points by default). Default is 5 contracts per order, but you can modify it in the code if you want (please adapt it to your account size). Could be adapted to other markets for sure.

// TF Giornaliero
// JR1976 TRADERS
// Molto Buono con Cumulate order LONG

// MM125=filtro lungo periodo , MM14 media di corto periodo per le operazioni long , MM4 media di corto periodo per le operazioni short + check RSI 2
// TIme Frame DAYLY
// MAX dd ...
// Loss ...

// JR1976 TRADERS

DEFPARAM Cumulateorders = true
//defparam flatafter = 220000
//defparam flatbefore = 130000

MM125=average[125](close)
MM14=average[14](close)
MM4=average[4](close)

RSI2 = RSI[2](close)
//h1 = high > Bollingerup[20]
short = RSI2 > 90
mm200=average[200](close)

// Condizioni per entrare su posizioni long
IF NOT LongOnMarket and close >MM125 and MM125>MM125[1] and close<MM14 THEN
 BUY 5 CONTRACTS AT high stop
 trading = 0
ENDIF
//if trading < 7 then
if trading < 5 then
 //IF LongOnMarket and close>mm200 and Close-TRADEPRICE(1)>1 then
 IF LongOnMarket and close>mm200 and TRADEPRICE(1)- close>1 then
  BUY 5 CONTRACTS AT market
  trading = trading +1
 ENDIF
endif

// Condizioni per uscire da posizioni long
//If LongOnMarket AND close>mml and close>close[1] THEN
If LongOnMarket AND close>MM14 THEN
 SELL AT market
ENDIF

// Stop e target: Inserisci qui i tuoi stop di protezione e profit target
if not shortonmarket and close<MM125 and MM125<MM125[1] and close>MM4 and short then
 sellshort 5 contracts at low-3 stop
endif

if shortonmarket and close<MM4 and close<close[1] and TRADEPRICE(1)- close>1 then
 exitshort at market
endif

//if shortonmarket then
//exitshort at high+10 stop
//endif
//set target pprofit 25
set stop ploss 100

 

 

Download
Filename: SP500-riding-the-trend.itf
Downloads: 886
Download
Filename: 1504538817l8cp4.png
Downloads: 435
JR1976 Veteran
Algo trader https://Scaffardi.blog
Author’s Profile

Comments

Logo Logo
Loading...