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.
-
-
10/02/2017 at 12:14 PM #47991
Sorry guys,
I know we have already talked about the prblem of the divided by zero!ùI have read what you have suggest to solve this problem,
but I still got the same issue. I can0t solve it by myself.
The system stops everyday
Can anyone help me please?
I post the strategy I use
THANKS TO juanj
DEFPARAM CumulateOrders = False // Cumul des positions désactivénoEntryBeforeTime = 090000
timeEnterBefore = time >= noEntryBeforeTimenoEntryAfterTime = 173000
timeEnterAfter = time < noEntryAfterTimedaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
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.1 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) and timeEnterBefore and timeEnterAfter and not daysForbiddenEntry 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 10
Set Stop pLoss 5010/02/2017 at 12:22 PM #4799310/03/2017 at 8:45 AM #48092I use it for eur/usd and still have the same divided through zero problem….
10/03/2017 at 11:55 AM #48108fabioerliam, you should use the “Insert PRT code” button (<> icon) on the grey bar to make your code more readable, like that:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332DEFPARAM CumulateOrders = False // Cumul des positions désactivénoEntryBeforeTime = 090000timeEnterBefore = time >= noEntryBeforeTimenoEntryAfterTime = 173000timeEnterAfter = time < noEntryAfterTimedaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0If longonmarket and close < positionprice and (barindex-tradeindex) > 650 ThenSell at marketElsIf shortonmarket and close > positionprice and (barindex-tradeindex) > 60 thenExitshort at marketEndIfbody=close-openabody=abs(body)if range>0.1 thenratio=abody/rangeelseratio=0endifmiddle=(open+close)/2bodytop=max(open, close)bodybottom=min(open, close)shadowtop=high-bodytopshadowbottom=bodybottom-lowlongcandle= (ratio>0.6)Bull = 0Bear = 0//Bullish SignalsMorningStar=(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 thenBull = 1 //PositiveendifPiercingLine=(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 thenBull = 1 //NoneendifAbandonedBabyBottom=(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 thenBull = 1 //NoneendifThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])if ThreeInsideUp thenBull = 1 //PositiveendifThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])if ThreeOutsideUp thenBull = 1 //PositiveendifThreeWhiteSoldiers=(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 DrawdownendifConcealingBabySwallow=(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 thenBull = 1 //NoneendifBullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])if BullishHarami then//Bull = 1 //Negative ImpactendifHomingPigeon=(body[1]<0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])if HomingPigeon thenBull = 1 //NoneendifBullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)if BullishEngulfing thenBull = 1 //PositiveendifLastEngulfingBottom=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)if LastEngulfingBottom thenBull = 1 //NoneendifDragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)if DragonflyDojiBottom thenBull = 1 //NoneendifGravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)if GravestoneDojiBottom thenBull = 1 //NoneendifDojiStarBottom=(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 thenBull = 1 //NoneendifBullishHaramiCross=(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 thenBull = 1 //NoneendifThreeStarsInTheSouth=(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 thenBull = 1 //NoneendifBullishBreakaway=(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 thenBull = 1 //NoneendifHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)if Hammer thenBull = 1 //NoneendifInvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)if InvertedHammer thenBull = 1 //NoneendifRisingThreeMethods=(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 thenBull = 1 //NoneendifBullishThreeLineStrike=(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 thenBull = 1 //NoneendifBullishMatHold=(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 thenBull = 1 //NoneendifBullSash=(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 thenBull = 1 //PositiveendifBullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody)if BullSeparatingLine thenBull = 1 //NoneendifBullishCounterAttack=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND close<=close[1])if BullishCounterAttack thenBull = 1 //NoneendifBullishKicking=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop=0 AND shadowbottom=0)if BullishKicking thenBull = 1 //Noneendif//Bearish SignalEveningStar=(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 thenBear = 1endifDarkCloudCover=(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 thenBear = 1endifAbandonedBabyTop=(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 thenBear = 1endifThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1])if ThreeInsideDown thenBear = 1endifThreeOutsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishengulfing[1] and close<close[1])if ThreeOutsideDown thenBear = 1endifThreeBlackCrows=(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 thenBear = 1endifUpsideGapTwoCrows=(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 thenBear = 1endifBearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])if BearishHarami thenBear = 1endifDescendingHawk=(body[1]>0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])if DescendingHawk thenBear = 1endifBearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)if BearishEngulfing thenBear = 1endifLastEngulfingTop=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)if LastEngulfingTop thenBear = 1endifDragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)if DragonflyDojiTop thenBear = 1endifGravestoneDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)if GravestoneDojiTop thenBear = 1endifDojiStarTop=(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 thenBear = 1endifBearishHaramiCross=(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 thenBear = 1endifAdvanceBlock=(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 thenBear = 1endifTwoCrows=(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 thenBear = 1endifBearishBreakaway=(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 thenBear = 1endifShootingStar=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody)if ShootingStar thenBear = 1endifHangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody)if HangingMan thenBear = 1endifFallingThreeMethods=(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 thenBear = 1endifBearishThreeLineStrike=(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 thenBear = 1endifBearishMatHold=(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 thenBear = 1endifBearSash=(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 thenBear = 1endifBearSeparatingLine=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowbottom<0.1*abody)if BearSeparatingLine thenBear = 1endifBearishCounterAttack=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND close>=close[1])if BearishCounterAttack thenBear = 1endifBearishKicking=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowtop=0 AND shadowbottom=0)if BearishKicking thenBear = 1endif//Entry/Exit Criteriapossize = 1NearMA = 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) and timeEnterBefore and timeEnterAfter and not daysForbiddenEntry Then//If shortonmarket Then//Exitshort at market//EndIfBuy possize contract at marketEndIfIf 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 marketEndIfSet Target pProfit 10Set Stop pLoss 50Roberto
10/06/2017 at 7:22 AM #4835210/06/2017 at 7:28 AM #4835610/06/2017 at 8:02 AM #4836410/06/2017 at 10:41 AM #4840510/06/2017 at 11:21 AM #4841710/06/2017 at 11:38 AM #48421What are this for variables you are optimizing? asd, asdasd, asdasdasd? Does this variables exist in your code and if so what do they stand for? If this variables don’t exist in your code you are creating an illusion. You should always run your WFA with the most influential variables of your strategy. On this strategy there are not many variables to use except TP, SL and maybe the period of the MAs.
So I’m little curious what you do with this new and variables. 🙂
10/06/2017 at 12:12 PM #4842510/06/2017 at 1:02 PM #4843210/06/2017 at 2:38 PM #4844910/06/2017 at 2:42 PM #48450If you need that help still after reading you should read it again. 😉 No offense but that’s the way it is.
To learn how to test strategies is mandatory if you want to get anywhere in strategy development. Producing a fancy looking BT is easy but to create a test that actually means something is a different story.
10/06/2017 at 4:00 PM #48460I made a FAQ about WFA in the blog section: https://www.prorealcode.com/blog/learning/prorealtime-walk-analysis-tool/
-
AuthorPosts
Find exclusive trading pro-tools on