Trend detection codes

Forums ProRealTime English forum ProOrder support Trend detection codes

Viewing 15 posts - 1 through 15 (of 45 total)
  • #178769

    Hi guys,

    I would like to know what kind of codes do you use for trend detection and which do you think are the most reliable; here’s some examples that i’ve applied before:

     

     

    #178773

    You mean SMA increasing … is going very well.

    1 user thanked author for this post.
    #178775

    Another one is Higher HIGHs + higher LOWs or Lower HIGHS + Lower LOWS:

    5 users thanked author for this post.
    #178781

    Link to above added as Log 306 here …

    Snippet Link Library

    3 users thanked author for this post.
    #178946

    Ciao Francesco, this is what I’m mostly using for primary trend these days for short TFs  (rising or falling MA, but separate long and short):

    2 users thanked author for this post.
    #186785

    Hi Roberto l have made a EA for MT4 but l want to code it on prorealtime but the coding different
    this is want i have done
    Function Start Time
    if is time >= H Start Hour M Start Minute
    Boolean variable ONCE to True
    Main Bar attach Start time Function(l learnt ONCE form You)
    if ONCE
    do Set BarCounter to BarCounter + 1
    Print Counter = BarCounter (text block)
    if barCounter = [65] bars
    do Set LC1 to Bar Close Shift of Lowest Close count [6] shift 1
    Set HC1 to Bar Close Shift of Highest close count [40] shift 1
    Set LHC1 to Bar Close Shift of Lowest High count [65] shift 1
    Boolean Set Once to False
    Variable Set barCounter to 0
    Print LC1 = (Variable) LC1
    Print HC1 = (Variable) HC1
    Print LHC1= (Variable) LHC1
    This is to back test if my EA is working on MT4 How would l start to write this code with ProrRealTime

    #188245

    I’d like a smart assessment from some smart people here.
    In the short-term sector (M5…M1) I have several of the same systems running with different filters as far as the trend is concerned. All sort of SMAs.
    3 variants as an example:
    Version 1:
    MA > MA[1]
    Most customizable, but seems to have the greatest propensity for over-optimization.
    Variant 2:
    close > MA
    Even better and quite robust.
    Variant 3:
    close > close(20)
    Surprisingly the most robust. For whatever reason. Now I wanted to hear your experiences, what have you had?

    #188273

    Hello phoentzs

    Interesting question.  Not sure I meet the definition of ‘smart people’  🙂 but here is my feedback which I hope is of use.  When testing different trend detection systems in a strategy I expect to see periods where the strategy doesn’t trade and a flat line appears on the equity curve.  Not trading is also a good option at times.

    With that in mind I tested the three different lines of code you posted, and ran them on higher time frames.  They didn’t fulfill my own personal requirements and the strategy kept trading. I appreciate this may differ from your own objectives here.

    Here is an example of what I use, which can be adapted to lower time frames.

     

    2 users thanked author for this post.
    #188275

    sam, that won’t work the way you’ve written it as FMA1 and FMA2 will be identical.

    FMA2 would need a different period or type … which I’m sure is what you meant 😁

     

     

    #188276

    Hi nonetheless

    Both “p” and “t” are different for both FMA1 and FMA2.  Perhaps I should have written it as “p1” and “p2” to make it more obvious  🙂

    #188277

    yeah, i assumed that is what you would have done. I was more concerned for total noobies just copying what you had posted and then wondering why there were 0 trades …

    2 users thanked author for this post.
    #188286

    Yes, I also use this variant. As a range filter, just to stay in my direction as much as possible. Perhaps I should have said that I use the variants I posted as an exit from the position at the same time. So you’re pretty close to the course. Depending on the market and timeframe between 10…20. And here, strangely enough, the Close>close(10…20) variant works best as a filter and simultaneous exit.

    1 user thanked author for this post.
    #188310

    @icharttop

    I’m so sorry, but I can’t translate that language, as I don’t know it.

    Maybe @Nicolas can.

     

     

    #188311

    Sorry I do not see any valid language here, only icharttop’s pseudo code 😆 and I don’t understand it!

    #188347

    Given that there is no perfect trend indicator , what if we add several trend indicators and find a “composite” trend indicator, to average the pros & cons of each one ?

     

    1 user thanked author for this post.
Viewing 15 posts - 1 through 15 (of 45 total)

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