Multiple consecutive candlesticks strategy

Multiple consecutive candlesticks strategy

Principle of multi-candle trading strategy:
The automated trading strategy expects X consecutive candles having the same direction to open a position.

Example: the chart has just formed 6 consecutive bulbs, and I want that at the opening of the 7th candle, the system automatically opens a trade short (with stop loss and take profit).

Parameters and Options:

  • Size of the position: in number of lots.
  • Stop loss: to determine how many pips / points of the entry price will be positioned the stop loss of an opened position.
  • Take Profit: To determine how many pips / points of the entry price will be positioned the take profit of an open position.
  • Number of candles to wait: to determine the number of consecutive candles having the same meaning to wait.
  • Trade inverse: true / false, this option allows you to choose whether the opening of the trade will be in the same direction or the reverse of the X consecutive candles.

Example: If the option is set to “False”, the system opens a purchase after X candles bullish. Conversely, if the option is set to “True”, the system then opens a sale after X candles bullish. In other words: on False, the system opens positions in the direction of the movement during formation. On True, the system opens positions against the trend of the movement being formed.

  • Trading accumulation: true / false, this option is used to fix whether the system should (or should not) open a new position if the spark plug X + 1 is also in the same direction as the previous X candles. Example: If the option is set to “False”, the system waits at least X candles after opening a new position. If the option is set to “True”, the system can then cumulate new positions directly to each subsequent candlestick.

Example 1 of the multi-candle system:
1/10 2/30 3/60 4/7 5 / True 6 / False This setting causes the system to wait 7 consecutive bullish or bearish candles to open a counter-meaning trade to the 8th candle. If this 8th candle also closes in the same direction as the previous 7 candles, the system does not open a new position at the opening of the 9th candle. * * Having already opened a position, the system waits again 7 consecutive candles From the 8th candle to possibly open a new position (if these candles from 8 to 14 are all in the same direction)

Example 2 of the multi-candle system:
1/10 2/30 3/60 4/3 5 / False 6 / True This setting means that the system expects 3 consecutive bullish or bearish candles to open a trade in the same direction to the 4th candle. If this 4th candle also closes in the same direction as the previous 3 candles, the system opens a new position directly at the opening of the 5th candle.

This trading strategy has been coded by a request on the French forum. Please consider that there is no typical settings and it is not dedicated to any instrument or timeframe at all. This strategy is almost like a “sandbox” for studying purpose and to define suitable parameters for your preferred instruments.

 

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Duck74 • 03/02/2017 #

    Molto bello sui 15m da ottimi risultati !!!

  2. Felix80 • 03/02/2017 #

    This is just that I was looking for!! Thanks a lot.

  3. David • 03/02/2017 #

    I think it’s important to note that the SET STOP pLOSS will not be a combined STOP LOSS if Cumulative = 0. Each trade will have it’s own SET STOP pLOSS StopLoss.

  4. lozano • 03/02/2017 #

    Hello all and thanks for sharing scripts!
    @Duck74: Did you try this scripts in real market?

  5. andre.vorster • 03/02/2017 #

    Hello.
    Great code.!
    I’m just so amazed by your guys coding ability (I can’t code to save my life even though I’m in IT – but learning a lot from the masters here and learning myself)Played with this code with various options across various commodities/FX and Indices.Running this now on Gold-mini 1 £ on IG demo account. Looks promising so far.From my back testing looks like this code is runs almost any time frame from 2min right up past 20min timescale.
    Thank you.

  6. Francesco78 • 03/02/2017 #

    Thank you Nicolas, great code, I have tried with the Bund future, with daily framework and the results look pretty amazing. 
    //PRC_TS multiple candlesticks | indicator//01.03.2017//Nicolas @ http://www.prorealcode.com//Sharing ProRealTime knowledge// Stops and targets// Stops and targets
    // — parametersSize = 100 //position sizeStopLoss = 25 //stoploss in pointsTakeProfit = 60 //takeprofit in pointsXcandlesticks = 5 //consecutive bullish or bearish candlesticks to open a new positionInverseTrading = 1 //(0=false ; 1=true) trade in the same direction of the candlesticks pattern or notCumulateOrder = 0 //(0=false ; 1=true) cumulate or not a new trade if the current candlestick is in the same trend as the pattern// ————
    //detecting patternsbearpattern = summation[Xcandlesticks](close<open)=Xcandlesticksbullishpattern = summation[Xcandlesticks](close>open)=Xcandlesticks
    //first orderif not onmarket thenif bearpattern thenif InverseTrading thenBUY Size CONTRACTS AT MARKETelseSELLSHORT Size CONTRACT AT MARKETendiflastbar = barindexlastpattern = -1endifif bullishpattern thenif InverseTrading thenSELLSHORT Size CONTRACT AT MARKETelseBUY Size CONTRACTS AT MARKETendiflastbar = barindexlastpattern = 1endifendif
    //cumulate order when a new pattern occurredif onmarket and not CumulateOrder and barindex-lastbar>=Xcandlesticks thenif bearpattern thenif InverseTrading thenBUY Size CONTRACTS AT MARKETelseSELLSHORT Size CONTRACT AT MARKETendiflastbar = barindexendifif bullishpattern thenif InverseTrading thenSELLSHORT Size CONTRACT AT MARKETelseBUY Size CONTRACTS AT MARKETendiflastbar = barindexendifendif
    //cumulate order when a new consecutive candletick happen right after the pattern occurredif onmarket and CumulateOrder and barindex-lastbar=1 thenif longonmarket thenif (close>open and lastpattern=1) or (close<open and lastpattern=-1) thenBUY Size CONTRACTS AT MARKETlastbar = barindexendifendifif shortonmarket thenif (close>open and lastpattern=1) or (close<open and lastpattern=-1) thenSELLSHORT Size CONTRACT AT MARKETlastbar = barindexendifendifendif
    SET STOP pTrailing StopLossSET TARGET PPROFIT TakeProfit

  7. Francesco78 • 03/02/2017 #

     Sorry I must add that it looks great only if we start the backtesting from 2008.
    Im not familiar with the forum yet, I cant upload the image of the backtesting for some reason.
    Apologies for this 

    • Nicolas • 03/02/2017 #

      You can’t upload images here, sorry.

  8. triss1965@gmail.com • 03/02/2017 #

    Hi, I dont understand, when I do the backtest I get only drawdown and a big loos? Have I missed something?

  9. Jessar • 03/02/2017 #

    Hi friends, is there any way to program the system to close the position when you have a longtrade an a bear candel is come ? thank you lg

  10. Pring00 • 03/02/2017 #

    Hello @Nicolas, thanks for this code! Just what i was looking for.

    I’m fairly new to this but do you have any suggestions to implement a code that makes you able to set a certain close of the candlestick? Let’s say i want 4 consecutive bullbars but i want all of them close 60% of the candlestick or higher

    • Nicolas • 03/02/2017 #

      Needs custom coding, ask for a mod in a dedicated topic, in the appropriate forum please.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+1 more likes

Related users ' posts
Vinks_o_7 Hi Bruno Could you tell me where I can find more info about Laguerre candlesick please ?
Vinks_o_7 oops sorry did not see that one had to untick the standard Price to see your candle...
avatar
Anonymous This is very useful, look forward to testing it out. Thank you very much
idunnomuch IS this working in the latest version of prorealtime? I get the indicator, but not over my c...
bernardmorel egalement apparait en dessous du graphique mais vide
bernardmorel Bonjour est t il possible de remettre en ligne the strat car il y a une indication qui d...
bibifricotin Je pense avoir compris dans la première colonne exemple 92 le 9 indique la période et le 2 ...
Leo_da_Pisa It seems to work very well. Good for confirmation. Thanks for sharing Vivien.
Pablo Carmona del Moral hola juanjo, muchas gracias por este screener que nos has compartido. creo que lo voy a util...
Pablo Carmona del Moral para el volumen he cambiado: // Volumen significativo VS=volume>2*(average[10](volume[1...
Juanjo Muchas Gracias Pablo, ...Tengo varios screener, uno lo tengo adaptado para operar intradía, ...
RGKP Hi Vonasi, great work! But what I do not understand is that the statistics change according ...
mr_delta Hi https://www.prorealcode.com/user/vonasi/ I am interested in in scanning for a similar set...
Vonasi Minor Bug Fix Please download an updated version with a minor bug fix from here: https://www...
Jesper Great share!
capgros Bonjour @Nicolas, Thanks a lot for this tool, it is very useful for me. I would like to s...
Hans63 Would you add the possibility to color also the Heikin Ashi and bar chart?
Nicolas That's possible, please open a new topic in the indicator forum explaining what you need exa...
Victor.Strand Hi Pableitor, the code is just great; i was playing a lil bit with these factors, darwsegmen...
micky_red Hi, I have tried to use this indicator in version 12 and it doesn't work. Do you know how...
Victor.Strand Hey Micky, indicator works well, justpaste the code on the platform, or save it as an "itf" ...
ckat55 Thank you Nicolas, is there any way that an alert can be set for when the dot appears?
Nicolas yes, change the last line with: RETURN wrb,qh and set an alarm with the alert tool for ea...
ckat55 Thank you Nicolas, I will try it.
Ravindra Khanna copied it to pro real time not working. what to do?
GraHal Wow! Thank you Vonasi, great idea!
Vonasi No Problem GraHal. Please share anything interesting that you find using it.
Vonasi I've made a small improvement by adding a Buy and Hold line for comparison. This line can be...
JohnScher indicators i did fond, no problem, but a basic code to trade maybe RSI divergence didn´t fou...
Daniel3987 Please how do I add the prc candle strength to my mt5 on an iPhone
Nicolas You can't, this indicator is made to be used with prorealtime trading platform.
777dks hi this doesnot seem to work on forex, any ideas? thanks.
4example excellent, thank you
avatar
Anonymous Thanks for sharing! On the other hand can we remove the vertical gray lines?
ShaunG Appreciated! Thanks 100%
tonbijl good afternoon when i enter the code i get an error message Syntax error

Top