3 Candle Strategy
Forums › ProRealTime English forum › ProOrder support › 3 Candle Strategy
- This topic has 82 replies, 6 voices, and was last updated 4 years ago by Regan2020.
-
-
08/01/2018 at 2:57 PM #7732608/01/2018 at 3:07 PM #7733608/01/2018 at 3:17 PM #7733808/01/2018 at 3:17 PM #77340
I’m sorry, but I’m a little slow on the uptake. To me that little bit of the Chart you show looks like a Buy Order with the trigger being the high of the 3rd candle??
the low of third candle is deeper than candle before…Ths condition wasn’t met for a sell order..
So for a sell order you don’t want the low of the third candle lower than the candle before … is that what you are saying? I’m confused by … Ths condition wasn’t met for a sell order.
Somebody else will probably pop in who can see exactly what you are saying? 🙂
Idea – it be good if you copied the bit of the code you are referring to?
08/01/2018 at 3:39 PM #77341Hi GraHal,
here’s the code and a screenshot.
123456789101112131415161718192021222324252627282930313233DEFPARAM CumulateOrders = true//Buy-Condition l1: Kerze vor 3 Perioden muss bullish sein und es müssen 3 Kerzen mit tieferen Hochs und tieferen Tiefs folgen und der Schlusskurs der vorherigen Kerze muss größer sein als der Schlusskurs der ersten Kerzel1 = OPEN[3] < CLOSE[3] AND High[3] > High [2] AND High[2] > High[1] AND Low[3] > Low[2] AND Low[2] > Low[1] AND Close[1] >= Close[3]//Buy-Condition l2: Kerze vor 3 Perioden muss bearish sein und es müssen 3 Kerzen mit tieferen Hochs und tieferen Tiefs folgen und der Schlusskurs der vorherigen Kerze ist größer als das Open der ersten Kerzel2 = OPEN[3] > CLOSE[3] AND High[3] > High [2] AND High[2] > High[1] AND Low[3] > Low[2] AND Low[2] > Low[1] AND Close[1] >= Open[3]//Sell-Condition s1: Kerze vor 3 Perioden muss bullish sein und es müssen 3 Kerzen mit höheren Hochs und höheren Tiefs und der SK der vorherigen Kerze ist kleiner als der SK's der ersten Kerze, wenn der SK von Kerze 1 kleiner als das Close ists1 = OPEN[3] < CLOSE[3] AND High[3] < High [2] AND High[2] < High[1] AND Low[3] < Low[2] AND Low[2] < Low[1] AND Close[1] <= Close[3]//Sell-Condition s2: Kerze vor 3 Perioden muss bearish sein und es müssen 3 Kerzen mit höheren hoch und hheren Tiefs und der SK der vorherigen Kerze ist kleiner als der SK's der ersten Kerze, wenn der SK von Kerze 1 kleiner als das Close ists2 =OPEN[3] > CLOSE[3] AND High[3] < High [2] AND High[2] < High[1] AND Low[3] < Low[2] AND Low[2] < Low[1] AND Close[1] <= Open[3]//Kauforder zur Eröffnung der nächsten Kerze wenn Konditionen l1 oder l2 erfüllt sindIF l1 OR l2 THENBUY 1 SHARES AT MARKET NextBarOpenENDIF//Verkauforder zur Eröffnung der nächsten Kerze wenn Konditionen s1 oder s2 erfüllt sindIF s1 OR s2 THENSELLSHORT 1 SHARE AT MARKET NextBarOpenENDIF//For LONG trades:IF LongOnMarket THENSET STOP LOSS (close - low[1]) //difference betwee current price and LOW of candle 3SET TARGET PROFIT (high[3] - close) //difference between the HIGH of candle 1 and current price (a lower current price is assumed)EndIF//For SHORT trades:IF ShortOnMarket THENSET STOP LOSS (high[1] - close) //difference betwee current price and HIGHof candle 3SET TARGET PROFIT (close - low[3]) //difference between the LOW of candle 1 and current price (a higher current price is assumed)EndIf08/01/2018 at 7:51 PM #7736608/01/2018 at 8:01 PM #7736708/01/2018 at 11:00 PM #77375Hi Vonasi,
I thought that the code works the following way:
candle 1, candle 2 and candle 3 meet the conditions. If they are in line with the strategy candle 0 shall be executing market order candle. TP and SL shall be linked with highs or lows of candle 1-3.
Du you understand what I mean?Regards Marc
08/01/2018 at 11:05 PM #77376Candle zero is the last closed candle. It is at the close of this candle that all decisions are made based on your code. The trade is opened at the open of the next candle.
It is as I showed in the image that I posted. Your strategy ignores the most recently closed candle and bases all its decisions on the three candles before. Subtract 1 from all your candle index numbers and maybe the strategy will trade how you think it should.
1 user thanked author for this post.
08/01/2018 at 11:43 PM #77377The last image appears to meet your condition l2.
l1
08/01/2018 at 11:52 PM #77378You must save your SL and TP and set them only once, otherwise they might change at any future bar, as Vonasi explained:
123456789101112131415161718192021222324252627282930DEFPARAM CumulateOrders = true//Buy-Condition l1: Kerze vor 3 Perioden muss bullish sein und es müssen 3 Kerzen mit tieferen Hochs und tieferen Tiefs folgen und der Schlusskurs der vorherigen Kerze muss größer sein als der Schlusskurs der ersten Kerzel1 = OPEN[3] < CLOSE[3] AND High[3] > High [2] AND High[2] > High[1] AND Low[3] > Low[2] AND Low[2] > Low[1] AND Close[1] >= Close[3]//Buy-Condition l2: Kerze vor 3 Perioden muss bearish sein und es müssen 3 Kerzen mit tieferen Hochs und tieferen Tiefs folgen und der Schlusskurs der vorherigen Kerze ist größer als das Open der ersten Kerzel2 = OPEN[3] > CLOSE[3] AND High[3] > High [2] AND High[2] > High[1] AND Low[3] > Low[2] AND Low[2] > Low[1] AND Close[1] >= Open[3]//Sell-Condition s1: Kerze vor 3 Perioden muss bullish sein und es müssen 3 Kerzen mit höheren Hochs und höheren Tiefs und der SK der vorherigen Kerze ist kleiner als der SK's der ersten Kerze, wenn der SK von Kerze 1 kleiner als das Close ists1 = OPEN[3] < CLOSE[3] AND High[3] < High [2] AND High[2] < High[1] AND Low[3] < Low[2] AND Low[2] < Low[1] AND Close[1] <= Close[3]//Sell-Condition s2: Kerze vor 3 Perioden muss bearish sein und es müssen 3 Kerzen mit höheren hoch und hheren Tiefs und der SK der vorherigen Kerze ist kleiner als der SK's der ersten Kerze, wenn der SK von Kerze 1 kleiner als das Close ists2 =OPEN[3] > CLOSE[3] AND High[3] < High [2] AND High[2] < High[1] AND Low[3] < Low[2] AND Low[2] < Low[1] AND Close[1] <= Open[3]//Kauforder zur Eröffnung der nächsten Kerze wenn Konditionen l1 oder l2 erfüllt sindIF l1 OR l2 AND Not OnMarket THEN //Not OnMarket will prevent SL & TP to be recalculatedSL = (close - low[1]) //difference between current price and LOW of candle 1TP = (high[3] - close) //difference between the HIGH of candle 3 and current price (a lower current price is assumed)BUY 1 SHARES AT MARKET //NextBarOpenSET STOP LOSS SLSET TARGET PROFIT TPENDIF//Verkauforder zur Eröffnung der nächsten Kerze wenn Konditionen s1 oder s2 erfüllt sindIF s1 OR s2 AND Not OnMarket THEN //Not OnMarket will prevent SL & TP to be recalculatedSL = (high[1] - close) //difference between current price and HIGH of candle 1TP = (close - low[3]) //difference between the LOW of candle 3 and current price (a higher current price is assumed)SELLSHORT 1 SHARE AT MARKET //NextBarOpenSET STOP LOSS SLSET TARGET PROFIT TPENDIF1 user thanked author for this post.
08/02/2018 at 8:48 AM #7738808/02/2018 at 9:09 AM #77389l1
My mistake – I got my open[3] < or > close[3] condition mixed up as I always write it the other way round – close before open!
08/02/2018 at 9:11 AM #77390It still looks mad -.-
Perhaps the strategy is not really that good
Or maybe it is better on a different market and a different time frame? But usually if it feels like a failure straight out of the box it usually is!
08/02/2018 at 9:17 AM #77392 -
AuthorPosts
Find exclusive trading pro-tools on