An old topic: how to describe a "trend" by algos ?

Discussion in 'Technical Analysis' started by Warren, Jan 22, 2019.

  1. Warren

    Warren

    Yes, I know there are many discussion stating that "trend" is subjective, and even unable to define. But what, if I just want to find a way to describe what I see in a chart? For example, the EURUSD 5 mins, 1h, 4h? There are time when the price is experiencing long consecutive periods going on one direction.

    I tried to describe this, by the divergence of SMAs, by calculating the StdDev between 3 different SMAs, for example SMA(6), SMA(9),SMA(26). While the results are quiet ridiculous: when the StdDev are large enough, 80% percent of the time it catches is the reversal !

    Maybe, it is because SMAs are too lagged behind the price. And maybe I could try EMAs instead.

    So, just want to open up an broader topic. Any clue to capture what we see in the chart when the market is moving one directional without too much compromise to include too many cases undesirable ?
     
    murray t turtle likes this.
  2. Describe it to a human first then find indicators that match each aspect of your description
     
    murray t turtle and tommcginnis like this.
  3. They

    They

    Technical definition - Uptrend = Higher highs and higher lows (bar segmentation choice is only subjective aspect)

    Ron Black's 'swingline indicator' might be what you are looking for, alternatively you could plot any ATR/Volatility stop and reverse indicator.
     
    Warren likes this.
  4. Custom made, quantifiable indicators within specific time-series. The value is in the values. ATR is a good starting point. That is all.
     
    Warren and nooby_mcnoob like this.
  5. tommcginnis

    tommcginnis

    The first clue is to reverse the order of your desired research goal: capture the (probability-driven) reversal before we "see it in the charts."

    As you've no doubt already read, 'trends' are either arbitrary (if designated a priori) or late (if designated post hoc). So, what are you going to do about it?

    Let's combine two thoughts here:
    Let your winners run; cut your losers short.
    and from ET's Buy1Sell2,
    The only true edge is in position management.
    They are in fact, two sides of the same coin: If you're going to be in the market, you're going to face losses. If you're going to face losses, then you must *insure* that your winners win more than your losers lose -- "Expectancy!" Yes[!] and since the only two things that affect trade outcomes are 1) The Market (which you cannot affect), and 2) Your Positions (over which you have 100% control), then your best bet for profitable long-run operations are from position management -- including and especially, having a finely-crafted Stop Loss and a ready hand on the Take Profit exit button.

    Ever wonder at why one of the standard measures of algo trading remains the Random Entry? It's because it stands as an objective marker that Trade Management is VITAL to stable/profitable ops. All the great entries in the world will not make up for bad decision-making on when/where/how to exit.

    SO! Back to The Trend idea:
    No matter how you formulate your entry rules as to what constitutes a trend, it is being consistent with that rule, and have closure of that trade, that matter more. So, no matter how you define "trend" -- having a rule in place (e.g., "Shrinking MACD histogram") that takes you out, BEFORE such a thing is plain in the graphing..... THAT is what will do you (and your account) best, in the long run.
     
    Last edited: Jan 22, 2019
  6. There are a few different ways of quantifying a trend within a given time series window. I see you are already familiar with SMA and EMA. Now try a simple linear regression fit on your chosen price points at your chosen time frame interval. Look at the regression residuals to give you a sense of the fitness of the regression model and use the resulting slope as an indication of trend.

    Hope it helps.

    J.
     
    Warren likes this.
  7. tomorton

    tomorton

    Simplest approach is always going to be least ambiguous, easiest to follow, less prone to misinterpretation.

    MA's are good at confirming trend and allowing its consistency to be gauged, but not good at identifying its start and end points.

    Two MA's is an approach that gives much information, one of shorter duration and one about 2-3 ties longer. If both slope upwards and the shorter is above the longer, its hard to see this as anything other than an uptrend. Consistency can be gauged by noting e.g. how many breaches of the MA's that price makes, how many complete bars are above and untouched by the longer MA, how many bar closes are above the longer MA etc.

    Entry location is less important than trend confirmation and selected the best confirmed trend. Personally I prefer an entry price for longs which is below the shorter MA but above the longer.
     
    birdman and Warren like this.
  8. Warren

    Warren

    Thank you for the advice, tommcginnis! You surely have a point that many gurus have emphasized. I am not sure whether I will have the guts to do random entrys. So, I think I still need some system that is at least profitable, and combine money management and other things together later.
     
  9. Warren

    Warren

    Hi J, thank you. I am surely interested to have a try. Although I know something in basic statistics, but still have no idea how to do this. Any further information or a thread ?
     
  10. Warren

    Warren

    Thank you They ! Definitely, I will give a try.
     
    #10     Jan 24, 2019