AirBag Defense System

Forums ProRealTime English forum ProOrder support AirBag Defense System

Viewing 14 posts - 1 through 14 (of 14 total)
  • #61821

    Hello everyone, Ivan Donatiello Here.

    My intention is to create a trading system that works to defend other strty, as breakout and meanrevertin systems in the portfolio.

    For example, I should trade the S & P 500 with an breakout system and mean reverting, and probably this week the high downward volatility is very dangerous.

    Then I implement a strategy that works as follows:

    Conditions to enter the trade short:

    1. Open> Close
    2. Close of today < Close of yesterday
    3. Today’s range higher than the average range of the last n days

    If the conditions are verified:

    1. Open a trade short at today’s low

    Stop loss conditions.

    1. + n point on today’s high

    Eixt:

    1. K * mean of the range at n days, where K is a decimal incremental factor> 1

    Here is the code that I did but that does not work:

    If we can thank you 🙂

     

    #61852

    You can write lines 10-11 as follows

    because both with LOWEST and HIGHEST you only check one bar, the previous one, making them unnecessary.

    Conditions look good and logically combined (assuming you are on a daily TF).  C2 requires the previous bar to be BEARISH or even BULLISH but with a current opening bearish gap no matter if filled, is that what you want?

    Maybe the average range of the last n bars is greater than the current one!

     

     

    #62302

    These are daily bars.

    I do not care about the gap, but the explosion of downward volatility.

    Even with your lines of code, the system opens only 5 positions then no longer closes the stop loss leaving the last position at a loss.

    It would be a shame not to realize this system as it could be an excellent balance of equity systems.

    PS: The place also in the Italian forum?

    #62303

    I think that your stoploss calculation is incorrect. As it currently is the stoploss would be huge  as close + high[1] = 2623 + 2628 = massive number of pips!

    Surely it should be high[1] – close so 2628 – 2623 = 5 pips.

    Also you might want to change IF NOT LONGONMARKET to IF NOT ONMARKET or put the stoploss calculation in a separate IF decision as otherwise the stoploss will be repeatedly recalculated once you are short on the market if the same conditions are met again.

    1 user thanked author for this post.
    #62555

    PS: The place also in the Italian forum?

    Please do not duplicate topics in order to have a wider range of help, because this might cause the opposite effect, leaving some suggestions on a forum and others on a different one, making it difficult and annoying for members to search and help. Thank you.

     

     

    #62559

    Since you used

    you correctly used price instead of pips (pLOSS deals with pips), but you are ADDING two prices, which will never be reached (within Eur/Usd, say 1.2110 + 1.2165 = 2.4275 which is…. you know what!), you may want to write

    or

    whatever you want.

     

     

    #62568

    you correctly used price instead of pips (pLOSS deals with pips)

    Well spotted @robertogozzi. I didn’t spot that as I never use Loss always pLoss – so I assumed again! At least I was right about the stoploss calculation! 🙂

    #62581

    “set stop loss” use distance in price and not a price level, so the correct syntax should be:

    Assuming it is a short order with the stoploss set at the High of the previous candlestick.

    1 user thanked author for this post.
    #62582

    Thank you Nicolas, I also always use pLOSS, sorry for the incorrect suggestion!

    #62583

    To set a Stop Loss at a given price you only have to use pending STOP orders (renewed at each bar), like

    is that correct Nicolas?

     

     

    #62585

    Thank you for the tips 🙂

    I rewrote the code, now it works.

    Now the system enters the market at the end of the current bar, it would be much better if the system entered the market during the bar when the volatility level was reached.

    For example:

    1. Enter the market when the price falls and volatility has exceeded 1.5 Atr [20].

    We hope we can do the metrics would improve a lot.

    See you soon 😉

    #62587

    Be warned that the above code works with S&P500, Dax and similar instruments, but it would not work with EurUsd, since

    would give 2.1220 (1.1220 + 1), instead of 1.1221 (1.1220 + 0.0001), so you’d better always use

    which will work with any instrument. It’s the system doing the conversion.

     

    1 user thanked author for this post.
    #62814

    Thank You 🙂

    #62885

    @robertogozzi

    Yes you are right about your statement for STOP orders. They expire at each bar so it’s necessary to put them continuously until your conditions are not true anymore.


    @richlab

    Not possible to do that until we get the long promise multiple timeframes support 😉

Viewing 14 posts - 1 through 14 (of 14 total)

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