1 Min Trading Strategy
Forums › ProRealTime English forum › ProOrder support › 1 Min Trading Strategy
- This topic has 219 replies, 29 voices, and was last updated 7 years ago by Leo.
-
-
08/31/2017 at 10:20 AM #4501508/31/2017 at 10:21 AM #45017
Do you mean EUR/USD? Always interesting.
I’m just gave it a try and added ATR trailing and dynamic TP. I come with the results pretty soon. So far it looks not hopelessly but not overwhelming either. We have so little data on this short TF. I have PRT premium but anyway I have only data beginning this year February. It was doing pretty well until about may. Since June the strategy is more or less flat (at least my current version).
08/31/2017 at 10:26 AM #45018@Inertia: With version are you running? This backtest looks pretty different from the one I ran. Do you mind sharing your version?
Or it was maybe the version you shared on the page before?
Did you maybe run your test without spread? If I do so with your code I get similar results.
08/31/2017 at 4:58 PM #45062Yes, version on previous page (4).
“Always and by default” my backtest ran with 1 pt spread for the Dax.
But just ran it now with 2 pt spread just to see. Attached as well. still green 🙂
@ JuanJ
I am a big fan of your work Boss 😉 (i.e. Short time frame strategies…) Thx again.
09/04/2017 at 10:07 PM #45428To solve the problem of ‘divide by zero’; one idea is to suppres the number of division by multiplying by this number
i.e. x/y = z is the same than x = z * y1234// for exampledojibull2 = open[2]<close[2] and abs(open[2]-close[2])/(high[2]-low[2])<0.6// becomesdojibull2 = open[2]<close[2] and abs(open[2]-close[2]) < 0.6 * (high[2]-low[2])1 user thanked author for this post.
09/05/2017 at 3:12 PM #45491UPDATE: So the original (longer) strategy is performing very well on the EUR/USD, but I again ran into the divide by zero error.
And as far as I could tell there is no division happening with variables that are zero or undefined. Very perplexing
1 user thanked author for this post.
09/05/2017 at 3:42 PM #4549409/05/2017 at 3:59 PM #4549509/05/2017 at 4:59 PM #45496Code I used for EUR/GBP + Walk forward analysis.
Only ran the WFA today. Have not had time time to run it. But so fat I’ve ran all the 3 strategies by Juanj on live account. Some on EUR/USD, USD/CHF, .
Am going to run WFA on all possible combinations and will publish them as they come.NOT MY CODE – THIS IS Juanj’s CODE.
I have not modified it. (I know my limitations 🙂 )
* 1 Min time
* Spread 0.8#########################################
Defparam cumulateorders = false
If longonmarket and close < positionprice and (barindex-tradeindex) > 650 Then
Sell at market
ElsIf shortonmarket and close > positionprice and (barindex-tradeindex) > 60 then
Exitshort at market
EndIfbody=close-open
abody=abs(body)if range>0 then
ratio=abody/range
else
ratio=0
endifmiddle=(open+close)/2
bodytop=max(open, close)
bodybottom=min(open, close)
shadowtop=high-bodytop
shadowbottom=bodybottom-low
longcandle= (ratio>0.6)Bull = 0
Bear = 0//Bullish Signals
MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
if MorningStar then
Bull = 1 //Positive
endifPiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1])
if PiercingLine then
Bull = 1 //None
endifAbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low)
if AbandonedBabyBottom then
Bull = 1 //None
endifThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])
if ThreeInsideUp then
Bull = 1 //Positive
endifThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])
if ThreeOutsideUp then
Bull = 1 //Positive
endifThreeWhiteSoldiers=(body[2]>0 and body[1]>0 and body>0 and high[1]>high[2] and high>high[1] and close[1]>close[2] and close>close[1] and open[1]>open[2] and open[1]<close[2] and open>open[1] and open<close[1])
if ThreeWhiteSoldiers then
//Bull = 1 //Increase Drawdown
endifConcealingBabySwallow=(body[3]<0 and body[2]<0 and body[1]<0 and body<0 and ratio[3]>0.8 and ratio[2]>0.8 and ratio>0.8 and open[1]<close[2] and high[1]>close[2] and shadowtop[1]>0.6*(abody[1]+shadowbottom[1]) and bodybottom<bodybottom[1] and bodytop>high[1])
if ConcealingBabySwallow then
Bull = 1 //None
endifBullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
if BullishHarami then
//Bull = 1 //Negative Impact
endifHomingPigeon=(body[1]<0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
if HomingPigeon then
Bull = 1 //None
endifBullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
if BullishEngulfing then
Bull = 1 //Positive
endifLastEngulfingBottom=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
if LastEngulfingBottom then
Bull = 1 //None
endifDragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
if DragonflyDojiBottom then
Bull = 1 //None
endifGravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
if GravestoneDojiBottom then
Bull = 1 //None
endifDojiStarBottom=(body[1]<0 AND longcandle[1] AND low<low[1] AND open<close[1] AND ratio<0.3 AND range<0.3*range[1])
if DojiStarBottom then
Bull = 1 //None
endifBullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
if BullishHaramiCross then
Bull = 1 //None
endifThreeStarsInTheSouth=(body[2]<0 and body[1]<0 and body<0 and shadowtop[2]<range[2]/4 and shadowbottom[2]>abody[2]/2 and low[1]>low[2] and high[1]<high[2] and abody[1]<abody[2] and shadowtop[1]<range[1]/4 and shadowbottom[1]>abody[1]/2 and low>low[1] and high<high[1] and abody<abody[1] and shadowtop<range/4 and shadowbottom<range/4)
if ThreeStarsInTheSouth then
Bull = 1 //None
endifBullishBreakaway=(body[4]<0 and body[3]<0 and body>0 and open[3]<close[4] and close[2]<close[3] and close[1]<close[2] and longcandle and close<close[4] and close>open[3])
if BullishBreakaway then
Bull = 1 //None
endifHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
if Hammer then
Bull = 1 //None
endifInvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
if InvertedHammer then
Bull = 1 //None
endifRisingThreeMethods=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and longcandle and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
if RisingThreeMethods then
Bull = 1 //None
endifBullishThreeLineStrike=(body[3]>0 and body[2]>0 and body[1]>0 and body<0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]>close[3] and close[1]>close[2] and open>close[1] and close<open[3])
if BullishThreeLineStrike then
Bull = 1 //None
endifBullishMatHold=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and close[3]>close[4] and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
if BullishMatHold then
Bull = 1 //None
endifBullSash=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>close[1] AND open<open[1] AND close>open[1] AND shadowtop<0.1*abody)
if BullSash then
Bull = 1 //Positive
endifBullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody)
if BullSeparatingLine then
Bull = 1 //None
endifBullishCounterAttack=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND close<=close[1])
if BullishCounterAttack then
Bull = 1 //None
endifBullishKicking=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop=0 AND shadowbottom=0)
if BullishKicking then
Bull = 1 //None
endif//Bearish Signal
EveningStar=(body[2]>0 AND body<0 and longcandle[2] and open[1]>close[2] and open<close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and high[1]>high and high[1]>high[2] and low[1]>open[2] and low[1]>close)
if EveningStar then
Bear = 1
endifDarkCloudCover=(body[1]>0 and body<0 and longcandle[1] and longcandle and open>high[1] and close<middle[1] and close>open[1])
if DarkCloudCover then
Bear = 1
endifAbandonedBabyTop=(body[2]>0 and body<0 and longcandle[2] and ratio[1]<0.3 and low[1]>high[2] and low[1]>high)
if AbandonedBabyTop then
Bear = 1
endifThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1])
if ThreeInsideDown then
Bear = 1
endifThreeOutsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishengulfing[1] and close<close[1])
if ThreeOutsideDown then
Bear = 1
endifThreeBlackCrows=(body[2]<0 and body[1]<0 and body<0 and longcandle[2] and longcandle[1] and longcandle and low[1]<low[2] and low<low[1] and close[1]<close[2] and close<close[1] and open[1]<open[2] and open[1]>close[2] and open<open[1] and open>close[1])
if ThreeBlackCrows then
Bear = 1
endifUpsideGapTwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and bodytop>bodytop[1] and bodybottom<bodybottom[1] and close>close[2])
if UpsideGapTwoCrows then
Bear = 1
endifBearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
if BearishHarami then
Bear = 1
endifDescendingHawk=(body[1]>0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
if DescendingHawk then
Bear = 1
endifBearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
if BearishEngulfing then
Bear = 1
endifLastEngulfingTop=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
if LastEngulfingTop then
Bear = 1
endifDragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
if DragonflyDojiTop then
Bear = 1
endifGravestoneDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
if GravestoneDojiTop then
Bear = 1
endifDojiStarTop=(body[1]>0 AND longcandle[1] AND high>high[1] AND open>close[1] AND ratio<0.3 AND range<0.3*range[1])
if DojiStarTop then
Bear = 1
endifBearishHaramiCross=(body[1]>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
if BearishHaramiCross then
Bear = 1
endifAdvanceBlock=(body[2]>0 and body[1]>0 and body>0 and high[2]<high[1] and high[1]<high and open[1]>bodybottom[2] and open[1]<bodytop[2] and open>bodybottom[1] and open<bodytop[1] and abody[1]<abody[2] and abody<abody[1])
if AdvanceBlock then
Bear = 1
endifTwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and close[1]>close[2] and open<bodytop[1] and open>bodybottom[1] and close<bodytop[2] and close>bodybottom[2])
if TwoCrows then
Bear = 1
endifBearishBreakaway=(body[4]>0 and body[3]>0 and body<0 and open[3]>close[4] and close[2]>close[3] and close[1]>close[2] and longcandle and close>close[4] and close<open[3])
if BearishBreakaway then
Bear = 1
endifShootingStar=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
if ShootingStar then
Bear = 1
endifHangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
if HangingMan then
Bear = 1
endifFallingThreeMethods=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and longcandle and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
if FallingThreeMethods then
Bear = 1
endifBearishThreeLineStrike=(body[3]<0 and body[2]<0 and body[1]<0 and body>0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]<close[3] and close[1]<close[2] and open<close[1] and close>open[3])
if BearishThreeLineStrike then
Bear = 1
endifBearishMatHold=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and close[3]<close[4] and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
if BearishMatHold then
Bear = 1
endifBearSash=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open>open[1] AND open<close[1] AND close<open[1] AND shadowbottom<0.1*abody)
if BearSash then
Bear = 1
endifBearSeparatingLine=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowbottom<0.1*abody)
if BearSeparatingLine then
Bear = 1
endifBearishCounterAttack=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND close>=close[1])
if BearishCounterAttack then
Bear = 1
endifBearishKicking=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowtop=0 AND shadowbottom=0)
if BearishKicking then
Bear = 1
endif//Entry/Exit Criteria
possize = 1
NearMA = Average[7,2](close)
If countofposition = 0 and Bull = 1 and NearMA[1] > NearMA[3] and RSI[2](close) > 75 and NearMA > Average[150,2](close) Then
//If shortonmarket Then
//Exitshort at market
//EndIf
Buy possize contract at market
EndIfIf countofposition = 0 and Bear = 1 and NearMA[1] < NearMA[3] and RSI[2](close) < 25 and NearMA < Average[150,2](close) Then
//If longonmarket Then
//Sell at market
//EndIf
//Sellshort possize contract at market
EndIfSet Target pProfit TP //WFA = 37 – 1min
Set Stop pLoss SL //WFA = 7 – 1min###############################################
09/05/2017 at 6:00 PM #45500CORRECTION.!!!!
PLEASE TAKE NOTE THE PREVIOUS CODE IS THE WRONG STRATEGY/CODE.
I’m sorry. My mistake.Here the code tested with WFA 1=min spread 0.8
The WFA analysis results of previous post still apllies.########################################
//Stategy: Scalping Candles
//Market: EUR/CHF
//Timeframe: 1min
//Spread: 0.8
//Author: Juan Jacobs (Jd3gjacobs@gmail.com)Defparam cumulateorders = false
If longonmarket and close < positionprice and (barindex-tradeindex) > 720 Then //Time Stop set to 12 hours
Sell at market
EndIf//Candle Paramaters
body=close-open
abody=abs(body)
if range>0 then
ratio=abody/range
else
ratio=0
endifbodytop=max(open, close)
bodybottom=min(open, close)
shadowtop=high-bodytop
longcandle= (ratio>0.6)
Bull = 0//Bullish Signals
BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
if MorningStar then
Bull = 1 //Positive
endifThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])
if ThreeInsideUp then
Bull = 1 //Positive
endifThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])
if ThreeOutsideUp then
Bull = 1 //Positive
endifBullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
if BullishEngulfing then
Bull = 1 //Positive
endifBullSash=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>close[1] AND open<open[1] AND close>open[1] AND shadowtop<0.1*abody)
if BullSash then
Bull = 1 //Positive
endifIf (high – low) = 0 Then //Prevents potential division by zero
HiLo = 1
Else
HiLo = (high – low)
EndIfHammerUp = min(open[1],close[1])>high[1]-(high[1]-low[1])/3
HammerUpNeg= max(open,close)<min(open[1],close[1]) and abs(open-close)/HiLo>0.5 //Bullish Hammer Negated = Bearish (used for exit signal)
HammerDown = max(open[1],close[1])<low[1]+(high[1]-low[1])/3
HammerDownNeg = min(open,close)>max(open[1],close[1]) and abs(open-close)/HiLo>0.5 //Bearish Hammer Negated = Bullish (used for exit signal)If HammerUp and HammerUpNeg Then
//Bull = 0
ElsIf HammerDown and HammerDownNeg Then
Bull = 1
EndIfdojibull2 = open[2]<close[2] and abs(open[2]-close[2])/(high[2]-low[2])<0.6
dojibull1 = open[1]<close[1] and abs(open[1]-close[1])/(high[1]-low[1])<0.6
dojibear2 = open[2]>close[2] and abs(open[2]-close[2])/(high[2]-low[2])<0.6
dojibear1 = open[1]>close[1] and abs(open[1]-close[1])/(high[1]-low[1])<0.6
hammerup2 = min(open,close)>high-(high-low)/2 //and max(open,close) < min(open[1],close[1])
hammerdown2 = max(open,close)<low+(high-low)/2 //and max(open,close)<min(open[1],close[1])//and timeokIf (dojibull2 and dojibull1) and hammerdown2 Then
Bull = 1
ElsIf (dojibear2 and dojibear1) and hammerup2 Then
//Bull = 0
EndIf//Entry/Exit Criteria
possize = 1
ATR = AverageTrueRange[4](close)
LongMA = Average[50,2](close)
NearMA = Average[6,2](close)
RSIChk = RSI[4](close) >= 80
StoChk = Stochastic[14,3](close) >= 75If countofposition = 0 and Bull = 1 and close > LongMA and NearMA > LongMA and LongMA[1] > LongMA[20] and NearMA[1] > NearMA[3] and ATR[1] > ATR[2] and RSIChk and StoChk Then
Buy possize contract at market
EndIf//comment on updated code
Set target pProfit TP // See WFA analysis image in previous post.
Set Stop pLoss SL // See WFA analysis image in previous post//EOF
09/05/2017 at 6:48 PM #4550909/05/2017 at 7:16 PM #45512rejo007.
I can’t say where the difference comes in between your and my the results. May be someone else can give input here.
The only difference I spot is you have spread 1,3 and I have spread 0,8.I would have liked to run WFA and backtesting 24/7 since I have access to almost unlimited processing power but because PRT is resetting their platform/computers every 18 hours it’s not possible. When they reset it also cancels one’s WFA and backtesting.
09/06/2017 at 8:48 AM #4556609/06/2017 at 9:21 AM #45569Results I get with 5 min WFA with 5 WFS repetitions.
09/06/2017 at 9:49 AM #45580The problem with your processing power Andre is that it will not really help a lot since PRT runs all backtests on the server side. 🙁
Then I think the mayor limiting factor is the amount of historical data we have. Especially on lower TFs it is too little. On daily TF it’s quite OK though I would like to see more data on the softs but on intraday TF…
-
AuthorPosts
Find exclusive trading pro-tools on