Moderator: admin
@ version = 3
// Add 3x the indicator on the TradingView chart. (Maximum indicator allowed for a free account)
// The indicator is displayed correctly only in 1 minute time unit.
// Two entries in the parameter menu:
// The first to set the unit of time in minutes.
// The second to set the display trimming 0.999 ==> 99.9%
study (title = "Free Warrior Indicator")
src = close
// Entries
TF1 = input ("1", title = "Time Unit 1 (minutes)")
display1 = input (0.998, title = "Cropping display 1", step = 0.002, maxval = 1.0, minval = 0.5)
// Find the selected unit of time
BougieRef1 = security (tickerid, TF1, src)
// Size of the EMA
ema_length1 = 3
ema_length2 = 9
// Calculation of EMA
ema1 = ema (src, ema_length1)
ema2 = ema (src, ema_length2)
// Calculation of EMAs taking into account the unit of time
mtfema1 = security (tickerid, TF1, ema1)
mtfema2 = security (tickerid, TF1, ema2)
// Calculation of EMA delta in UT + minimal smoothing
disp1 = security (tickerid, TF1, (mtfema1-mtfema2 + (src + src + src [1]) / 3)) // Smoothing, closer to FXCM like that
delta1 = security (tickerid, "D", (src * display1))
// Exit
colorCond1 = mtfema1-mtfema2> 0? lime: red // Green display when EMA 3> EMA 9, red otherwise
// Outputs display
plot (disp1-delta1, color = colorCond1, style = columns, transp = 0, editable = true) // Result - Output trimming as a graph
Users browsing this forum: No registered users and 168 guests