TradingView
degendcrypto
6 sty 2022 12:00

MA with options 

Fantom / TetherUSBinance

Opis

5 Types of Moving Averages have been combined into the script. The user has the liberty to select the length of the MA and the MA type (SMA, EMA, WMA, VWMA, RMA) of his/her choice.

Informacje o Wersji

I have just updated my first practice code by adding MA crossover for MA2 and MA3 with buy and sell signals.

Informacje o Wersji

The Default value for the first three moving averages have been modified into EMA. Since EMA provides the recent data and updates faster as compared to the SMA it can be used to identify trends better.
The EMA crossover is between EMA 21 (MA2_type) and EMA 34 (MA3_type). The values can be modified and backtested according to the users wish.
The Sell Signal triangle down arrow was green in color and it has been modified to red by default.
Komentarze
BBB888B
hi, may i knw hw can put the colour if up/downtrend inside between trend line . example 5 & 20 ma cross. tq.
degendcrypto
@BBB888B, You have to check what all parameters can be added for location. In my script I have used location=location.belowbar and location.abovebar respectively in the plotshape function. You can play around with the location option and choose one which you like. Use the help function and see what all parameters are accepted.
Raj_Sor
just a copy paste
degendcrypto
@Raj_Sor, I know it isn't something new. I'm just learning to code and have no idea how to share it with my friends privately so just published it.
Więcej