Momentum-Range Differential Acceleration System

Viewing 15 posts - 31 through 45 (of 52 total)
  • Author
    Posts
  • #34096 quote
    wp01
    Participant
    Master

    My idea is that it only works with DFB.

    The English users with DFB (https://www.ig.com/uk/glossary-trading-terms/dfb-definition)

    do not have problems, all others, including all other European countries can not get it working properly.

    #34106 quote
    GraHal
    Participant
    Master

    I’m sure you’ve tried these … minimum contract >1?

    Also does buy ‘Shares‘ work okay with non-DFB??

    if bc1 then
    buy 1 shares at market
    set target pprofit wintarget
    barIndexAtBuy = barIndex
    endif
    #34115 quote
    wp01
    Participant
    Master

    Hi GraHal.

    Thank you for your reply.

    The lines you show are in the code (including the buy 1 share) and do not give any trades unfortunately.

    #34116 quote
    Elsborgtrading
    Participant
    Veteran

    @wp01 did you try my version, on former page

    #34118 quote
    GraHal
    Participant
    Master

    @wp01 I didn’t say it the best way, I was suggesting … might Buy CONTRACTS  work with non-DFB…

    if bc1 then
    buy 1 CONTRACT at market
    set target pprofit wintarget
    barIndexAtBuy = barIndex
    endif
    wp01 thanked this post
    #34122 quote
    wp01
    Participant
    Master

    Hi Kasper,

    With your version i do get trades but very different results as your picure shows.

    The data also starts at the end of 2016 instead of your in 2015.

    2017-05-01.png 2017-05-01.png
    #34125 quote
    Elsborgtrading
    Participant
    Veteran

    mine is running from may 2015 yours is from nov 2016- 100000 units?

    #34127 quote
    wp01
    Participant
    Master

    Mine too after changing it…:-)

    Thanks and sorry for the “rookie mistake”

    #34141 quote
    Elsborgtrading
    Participant
    Veteran

    no problem:-)

    #34192 quote
    Maz
    Participant
    Veteran

    Guys the original system was optimized for the DFB offering.

    You will need to optimize again for any other instrument including time constrsints, pipsize, “shares/contracts/perpoint” if applickable and spreads if any.

    Best

    M

    #34193 quote
    ALE
    Moderator
    Master

    Maz,

    Hello It’s quite difficult for me to understand the code, I’ve not your big knowledge..So I’ve some problem to start to optimize.. I’ll try it, but if you want make an explanation for stupid, here I’m  🙂

    Thanks very much to participate to the forum!

    #34242 quote
    Maz
    Participant
    Veteran

    @Ale, guys,

    If you take a look at the indicator I posted to the library it has the explanation on the premise of the system.

    The system takes a long on a prediction of increased volatility whilst we are in an uptrend. Prediction of increased volatility is made using two indicators in this case – differentials between long and short term candle ranges as well as long and short term and momentum. There are two versions of the system because range and momentum delta can be measured in various ways (eg differential or a coefficient). The uptrend filter is confirmed by a moving average comparison. The likelihood of volatility to the upside is greater than volatility to the downside if we are in an uptrend, which is why we use a moving average filter. If you were creating a short system, the reverse would be true. The ATR filter ensures that we don’t take trades during low volatility periods.

    In order to optimize you need to understand what sensible ranges would be. You can make custom indicators out of the indicators included in the system code and plot them on a graph. That will give you a graphical representation of ranges for the instrument you want to try. Alternatively you can use the GRAPH function. Once you know the indicator ranges you can work with the optimizer tool.

    Hope that helps?

    jonjon thanked this post
    #34595 quote
    victormork
    Participant
    Veteran

    Here is an improved version for DOW 1H. Spread 3p.

    jonjon thanked this post
    Coefficient-Long-DOW-1H.itf
    #37549 quote
    Wilko
    Participant
    Senior

    Firstly, many thanks for sharing this!

    I have converted your style of coding into my own style. Result here:

     

    MomShort = Momentum[5](close)
    MomLong = Momentum[100](close)
    MomCoef = MomShort/MomLong - 1
    SMARange = Average[4,0](Range)
    LMARange = Average[100,0](Range)
    RangeCoef = SMARange/LMARange - 1
    SMA = Average[18,1](close)
    LMA = Average[53,1](close)
    
    TradeTime = BarIndex - TradeIndex
    MinTradeTime = 43
    MomThreshold = 0.1
    RangeThreshold = 0.9
    UpBar = close > open
    
    LongEntry = NOT LongOnMarket
    LongEntry = LongEntry AND MomCoef >= MomThreshold
    LongEntry = LongEntry AND RangeCoef >= RangeThreshold
    LongEntry = LongEntry AND UpBar
    LongEntry = LongEntry AND SMA > SMA[1]
    
    LongExit = LongOnMarket
    LongExit = LongExit AND TradeTime >= MinTradeTime
    LongExit = LongExit AND LMA < LMA[4]
    
    WinTarget = 43
    
    // Conditions to enter long positions
    IF NOT LongOnMarket AND LongEntry THEN
    BUY 1 CONTRACTS AT MARKET
    SET TARGET pprofit WinTarget
    ENDIF
    
    // Conditions to exit long positions
    IF LongOnMarket AND LongExit THEN
    SELL AT MARKET
    ENDIF

     

    Perhaps this can help others understand the logic. Some thoughts:

    1. The Exit condition could be thought of as referring to another timeframe, namely 1h. The exit time condition is similar to MA25<MA25[1] on the 1h timeframe. What it achieves is 1. it gives room for the trade to play out and 2. it gives room for the trade to play out even further beyond the exit condition if the MA100 is sloping upwards. A nice continuation of the trendfollowing aspect.
    2. I will test sensitivity to the all the different constants/variables in order to see if there is some risk of lucky curve -fit. I would recommend this to each and every one trying this code out.
    3. As has been pointed out by Maz, this is not a ready-to-go code. One particular area is it’s vulnerability to a large setback in the 43 bars following the entry. One would absolutely need to implement a stop to avoid potential bankruptcy.

    All in all, I would say this is a really nice piece of code. Both for instructional use and learning to code, and potentially as a backbone in a live trading system. The logic makes perfect trading sense. Thanks again for posting! I salute your generosity!

     

    >> Message edited to make appear PRC code format, for clarity of messages on ProRealCode’s forums, please use the “<> insert PRT code PRT” button during message creation to separate the text of the code part, thank you! <<

    jonjon and Maz thanked this post
    Test-MomRange-Accel.itf
    #37604 quote
    Wilko
    Participant
    Senior

    One note on the above post: I omitted doing absolute values of momentum. Thought it wouldn’t detract a lot to do so. It does. MomShort and MomLong variables should be absolute values of momentum, ie:

    MomShort = ABS(Momentum[5](close))
    MomLong = ABS(Momentum[100](close))
Viewing 15 posts - 31 through 45 (of 52 total)
  • You must be logged in to reply to this topic.

Momentum-Range Differential Acceleration System


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Maz @eqmaz Participant
Summary

This topic contains 51 replies,
has 13 voices, and was last updated by victormork
8 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/19/2017
Status: Active
Attachments: 9 files
Logo Logo
Loading...