EMA5 – TMA8 trading signals

EMA5 – TMA8 trading signals
Hi all, Here is a simple code asked by one of my website user. We have a BUY signal (green) if :
  • the exponential average 5 (close) > the triangular average 8 (close)
  • close > triangular average 8 but close of the previous candle < triangular average 8
Of course, we have a SELL signal (red) for the inverted conditions. Don't forget to set "achat" and "vente" to Histogram, and to set the colors. I also added a blue line with value "0". The EMA5 is in red, the TMA8 is in blue.
achat = 0
vente = 0

// INDICATEURS
EMA5 = ExponentialAverage[5](close)
TMA8 = TriangularAverage[8](close)

// ACHAT
ca1 = close[1] < TMA8 and close > TMA8
ca2 = EMA5 > TMA8

IF ca1 and ca2 THEN
achat = 1
ENDIF

// VENTE
cv1 = close[1] > TMA8 and close < TMA8
cv2 = EMA5 < TMA8

IF cv1 and cv2 THEN
vente = -1
ENDIF

return achat as "ACHAT", vente as "VENTE"
Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

New! PRC is also now on YouTube, subscribe to our channel for exclusive content and tutorials

  1. gianlox • 17 days ago #

    I added a simple momentum indicator (MACD). I think much better results:

     

    achat = 0
    vente = 0
    MACD12M = MACDline[12,26,9](close)
    MACD12S = ExponentialAverage[9](MACD12M)

    // INDICATEURS
    EMA5 = ExponentialAverage[5](close)
    TMA8 = TriangularAverage[8](close)

    // ACHAT
    ca1 = close[1] < TMA8 and close > TMA8
    ca2 = EMA5 > TMA8

    IF ca1 and ca2 AND MACD12M>MACD12S AND MACD12M[1]>MACD12S[1] THEN
    achat = 1
    ENDIF

    // VENTE
    cv1 = close[1] > TMA8 and close < TMA8
    cv2 = EMA5 < TMA8

    IF cv1 and cv2 AND MACD12M<MACD12S AND MACD12M[1]<MACD12S[1] THEN
    vente = -1
    ENDIF

    return achat as “ACHAT”, vente as “VENTE”

     

    happy New Year !!!

  2. gianlox • 17 days ago #
    achat = 0
    vente = 0
    MACD12M = MACDline[12,26,9](close)
    MACD12S = ExponentialAverage[9](MACD12M)
    
    
    // INDICATEURS
    EMA5 = ExponentialAverage[5](close)
    TMA8 = TriangularAverage[8](close)
    
    // ACHAT
    ca1 = close[1] < TMA8 and close > TMA8
    ca2 = EMA5 > TMA8
    ca3 = MACD12M>MACD12S AND  MACD12M[1]>MACD12S[1]
    
    IF ca1 and ca2 AND ca3 THEN
    achat = 1
    ENDIF
    
    // VENTE
    cv1 = close[1] > TMA8 and close < TMA8
    cv2 = EMA5 < TMA8
    cv3 = MACD12M<MACD12S AND  MACD12M[1]<MACD12S[1]
    IF cv1 and cv2 AND  cv3 THEN
    vente = -1
    ENDIF
    
    return achat as "ACHAT", vente as "VENTE"
    

     

avatar
Register or

Likes

avatar avatar avatar avatar
Related users ' posts
Nicolas
3 weeks ago
Holt EMA
Holt EMA
0
Indicators
Nicolas Thanks a lot, a lot of people will find it useful! About customclose of the daily OHLC, you...
supertiti Voici un code de VIDYA construit par Sohocool : // MOYENNE EXPONENTIELLE ADAPTIVE VIDYA by ...
Matriciel Merci Supertiti. Je trouve que ce code est difficile à règler et n'est pas d'une grande pré...
Ernesto1 J'ai essayé avec deux différents I ,  a =  3 périodes et un 3 x 5 = 15 périodes.Ie comme si ...
SoloContado Hello Nicolas,   thanks a lot for your many contributions in this post. I have a prob...
Nicolas Because of no data available at the start of calculations. Add this at line 15 : if barindex...
century hi i will use it to see ... and get back to tell ya
luigi Ciao Nicolas. Approfitto di questo spazio per chiederti se puoi aiutarmi. Avrei bisogno di u...
Nicolas Si prega di utilizzare i forum per chiedere richieste di codice per favore.
triss1965@gmail.com HELP, WHY DONT I NOT GOT THE INDICATOR IN CHART. JUST UNDER?????????????
Nicolas Use the wrench on the upper left side of your price chart to add correctly indicator on PRICE.
Somatolysis   Hi IGOSNELL, you´ll find other of my strategies here - but without the code - maybe...
IGOSNELL Thanks but unfortunately can't read German. If you can show that your strategies can work on...
Nicolas Thank you for contribution. Please consider that advertising is tolerate as long as you cont...
finplus Hi Wanjpt, I tried once only on AUD / USD in november 2016 during one day. No position has b...
finplus The backtest of the code works perfectly with 1 hour timeframe.
CN Anyone got a correct code for the setup?Used Minihax code with mixed results... Anyone that ...
Nicolas Ok Doc, beware of intraday, it's a battlefield full of random noises :) Maybe we can work to...
phili711 Bonjour Si la moyenne 100 est au dessus de la moyenne 20 le trend est baissier zlors pourqu...
Nicolas La comparaison se fait entre la valeur de la moyenne actuelle et telle qu'elle était il y a ...
daveAF
11 months ago
Nicolas You have certainly apply the indicator twice on the price chart. If you want to hide one of ...
fabriziomerlo Buongiorno Nicolas,  come faccio a trasformare questo interessantissimo indicatore in uno s...
Nicolas Si desidera testare una croce sopra di 2 media mobile? Si prega di fare un argomento nel for...

Top