Tested on EURUSD. Very basic, not too frequent but quite reliable. Playing with the candle sticks.
DEFPARAM PRELOADBARS = 10000
DEFPARAM CumulateOrders = FALSE
//settings
n = 1
TP = 1
SL = 10
CS = 0.3 //candle size
//end of settings
GoTrade = time>=070000 and time<=213000
body = close-open
c1 = body[3]>CS and body[2]>CS and body[1]<-CS and body>CS and low<low[1] and low<low[2] and body[4]>0 and low[1]>low[4] and low[1]>low[2]
c2 = body[3]<-CS and body[2]<-CS and body[1]>CS and body<-CS and high>high[1] and high>high[2] and body[4]<0 and high[1]<high[4] and high[1]<high[2]
if c1 and GoTrade then
buy n contracts at market
endif
if c2 and GoTrade then
sellshort n contracts at market
endif
set target pprofit TP
set stop ploss SL
Hi, thanks a lot for sharing your automatic trading strategy with us. Could you please provide more information about your backtest please? What is the timeframe? What is the period? It would help everyone to have a better opinion about the strategy 🙂
Thank you for sharing @Thomas007 … I get attached with code below (I changed TP and SL) on DJI 5M TF with spread = 2 over 100k bars
//https://www.prorealcode.com/topic/moz-scalp-strategy/
DEFPARAM PRELOADBARS = 10000
DEFPARAM CumulateOrders = FALSE
//settings
n = 1
CS = 0.2 //candle size
//end of settings
GoTrade = time>=070000 and time<=213000
body = close-open
c1 = body[3]>CS and body[2]>CS and body[1]<-CS and body>CS and low<low[1] and low<low[2] and body[4]>0 and low[1]>low[4] and low[1]>low[2]
c2 = body[3]<-CS and body[2]<-CS and body[1]>CS and body<-CS and high>high[1] and high>high[2] and body[4]<0 and high[1]<high[4] and high[1]<high[2]
if c1 and GoTrade then
buy n contracts at market
endif
if c2 and GoTrade then
sellshort n contracts at market
endif
If Longonmarket Then
set target pprofit 15
set stop ploss 30
endif
If shortonmarket Then
set target pprofit 15
set stop ploss 25
endif
Instead of dealing with negative/positive values you might use ABS in line 13
body = abs(close-open)
also
CS = 0.3
is your treshold value, but, for example:
- Dax will (almost) NEVER have such a small difference in price, something like opening at 12500.0 and closing at 12500.3
- Forex pairs need will HARDLY have that difference in a single candlestick, EurUsd opening at 1.1500 then dropping suddenly to 0.8500 or raising to 1.4500
I suggest that you refer to PIPS and use the reserved word
pipsize
to let ProOrder do the math.