Pro back-testing bullish / bearish heikin-ashi simple signal / variable

Forums ProRealTime English forum ProOrder support Pro back-testing bullish / bearish heikin-ashi simple signal / variable

  • This topic has 17 replies, 3 voices, and was last updated 2 years ago by avatarJS.
Viewing 15 posts - 1 through 15 (of 18 total)
  • #199923

    Dear all,

    Apologies, first of all, for my ignorance in this subject:

    I am trying to simply combine the bullish heikin-ashi (green candle) closure with one moving average overcrossing (for longs) and a bearish heikin-ashi (red candle) clousure with moving average undercrossing (for bearish). The application does not have the variables to back-test on the basis of such condition of a heikin-ashi signal (bullish or bearish signal -first green or red candle) – (case by case). Hence, I would like to ask if any of you could be so kind to let me know how would the variable in the backtesting code should read to that effect. Thank you very much in advance.

    #199924

    Apologies for the second post in a row (unfortunately I could not amend the previous one, sorry for this).

    Meanwhile, I found a previous topic dealing partly with my question (pending to be answered; how to combine heikin-ashi with crossing (over and/or under a simple moving average): https://www.prorealcode.com/topic/heikin-ashi-auto-buy-sell-based-on-collor-change/

    Based on that information I came up with the below “back test code” for the SP500 but it is not showing any results when I ask the application to generate the report, (I must be missing something due to my ignorance):

    #199927
    JS
    1. Delete the Call instructions
    2. Bullish = xClose > xOpen is always equal to 1 or 0 and a 1 or a zero cannot cross with an average. Use “xClose crosses over indicator1”
    3. Same for Bearish
    1 user thanked author for this post.
    #199991

    Thank you for your reply.

    May you be so kind to repost the code with the recommended amendments / corrections for my easier guidance. Thank you in advance.

    #199996
    JS

    Hi @jonpt88

    When you use 1 moving average and you want to go both long and short, your base code is limited to:

    (xClose = (Open + Close + High + Low) / 4)

    If xClose crosses over Average[50](Close) then

    Buy 1 contract at Market

    EndIf

    If xClose crosses under Average[50](close) then

    SellShort 1 contract at Market

    EndIf

     

    1 user thanked author for this post.
    #199997

    Thank you.

    #200975

    Is there anyway to add to the back test a third variable? What would be the continuation of the CODE if I may ask? Thank you.

    #200976
    JS

    Hi @jonpt88

    What do you want to do with that third variable?

    What feature do you want to add?

    1 user thanked author for this post.
    #201224

    Hi, a simple RSI. There must a code to allow back test to be subject to overbought / oversold umm

    #201232
    JS

    Hi @jonpt88

    I have modified your first code, Heikin Ashi + Moving Average

    You can now back test the code

    For optimization, you can run the period of the Moving Average, for example, between 1 and 100

    1 user thanked author for this post.
    #201254

    Looks like a profitable one 🙂

    #201255

    Many algos is profitable without stoploss, but u need to swing a big d**k😉

    #201256

    Do you know how to add a third variable like I ask – an RSI for example?

    #201257
    JS

    You can add an extra condition with RSI for example:

    C1 = (Bullish and Bearish[1]) and xClose Crosses Over indicator 1 and RSI(16) Crosses Over 20

    C3 = (Bearish and Bullish[1] and xClose Crosses Under indicator 1 and RSI(16) Crosses Under 80

    1 user thanked author for this post.
    #201258

    Nice – would it be possible for you to add that to the code with such variable – regardless of the back test result 🙂 That would be very much appreciated.

Viewing 15 posts - 1 through 15 (of 18 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login