Raghee Horner Grab Candles Strategy

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #211989 quote
    Edoardo
    Participant
    New

    Hi Guys,

    I was thinking to build a strategy, but indeed I do not have knowledge with programming language. Could someone helps me in creating a strategy by using this indicator:

    RAGHEE HORNER GRAB CANDLES

    I think it’s better than the Heikin-Ashi bars, which may not provide a clear indication of a sideways market.

    The strategy is as follows:

    1. Trend identification: The colour of the bars helps to identify the current trend. Green bars suggest an uptrend, red bars suggest a downtrend, and blue bars suggest a sideways market.
    2. Entry signal: For long trades, wait for the first green bar after a series of red bars to confirm the start of an uptrend. For short trades, wait for the first red bar after a series of green bars to confirm the start of a downtrend. No trades are taken when the bars are blue as it suggests a sideways market with no clear direction. Maybe it could be added a further variable: the ADX values should be above 20 or better 25 indicating a strong trend.
    3. Stop-loss placement and Take-profit target: Use a trailing stop-loss to ride the trend until it shows signs of reversal.

    Many thanks and sorry if I asked a trivial or already discussed question.

    ciao

    Edo

    #211995 quote
    JS
    Participant
    Senior

    Hi @Edo,

    Maybe a starting point…

    DefParam CumulateOrders = False
    
    Once EMAPeriod = 26
    Once ADXPeriod = 6
    Once TStart = 20 //Trailing Start
    Once TStep = 2 //Trailing Step
    
    a=exponentialaverage [EMAPeriod] (high) //Upper Grab
    b=exponentialaverage [EMAPeriod] (low) //Lower Grab
    c=ADX[ADXPeriod] //Average Directional Index 
     
    If Close > a and Close[1] < a and c > 25 then //Start UpTrend and ADX>25
    Buy 1 contract at Market
    EndIf
     
    if Close < b and Close[1] > b and c > 25 then //Start DownTrend and ADX>25
    SellShort 1 contract at Market
    EndIf
    
    //************************************************************************
    //trailing stop function
    trailingstart = TStart //trailing will start @trailinstart points profit
    trailingstep = TStep //trailing step to move the "stoploss"
    
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
    
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THEN
    newSL = tradeprice(1)+trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    ENDIF
    ENDIF
    
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
    newSL = tradeprice(1)-trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
    newSL = newSL-trailingstep*pipsize
    ENDIF
    ENDIF
    
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    //************************************************************************
    Nicolas and GraHal thanked this post
    Scherm­afbeelding-2023-03-23-om-16.19.09.png Scherm­afbeelding-2023-03-23-om-16.19.09.png
    #211997 quote
    Edoardo
    Participant
    New

    Thank you very much JS! You were as fast as lightning! I will test it, it looks promising 🙂

    JS thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Raghee Horner Grab Candles Strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Edoardo @sparrowhawk Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Edoardo
2 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/23/2023
Status: Active
Attachments: 1 files
Logo Logo
Loading...