Annonce
Réduire
Aucune annonce.
Ads
Réduire
Wti
Réduire
X
-
Coucou,
Je poste ici pour ne pas trop flooder la file de raptou ...
Je me suis rajouter dans la matrice un GAP détector. Le SP sur la semaine les referme les un apres les autres. ça donne des niveaux vraiment super précis de support ou résistance
- j'aime 1
Commentaire
-
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © dgtrd
//@version=4
study("STPMT avec croix galadd", "STPMT avec croix", false, format.price, 2, resolution = "", resolution_gaps = false)
i_periodK1 = input(5 , "K1 : Length", minval=1, inline = "K1", group="STPMT Settings")
i_smoothK1 = input(3 , "Smooth" , minval=1, inline = "K1", group="STPMT Settings")
i_weightK1 = input(4.1 , "Weight" , minval=1, inline = "K1", group="STPMT Settings", step=.1)
i_periodK2 = input(14 , "K2 : Length", minval=1, inline = "K2", group="STPMT Settings")
i_smoothK2 = input(3 , "Smooth" , minval=1, inline = "K2", group="STPMT Settings")
i_weightK2 = input(2.5 , "Weight" , minval=1, inline = "K2", group="STPMT Settings", step=.1)
i_periodK3 = input(45 , "K3 : Length", minval=1, inline = "K3", group="STPMT Settings")
i_smoothK3 = input(14 , "Smooth" , minval=1, inline = "K3", group="STPMT Settings")
i_weightK3 = input(1. , "Weight" , minval=1, inline = "K3", group="STPMT Settings", step=.1)
i_periodK4 = input(75 , "K4 : Length", minval=1, inline = "K4", group="STPMT Settings")
i_smoothK4 = input(20 , "Smooth" , minval=1, inline = "K4", group="STPMT Settings")
i_weightK4 = input(4. , "Weight" , minval=1, inline = "K4", group="STPMT Settings", step=.1)
i_data = input(true, "Components of the STPMT", group="STPMT Settings")
i_colorK1 = input(color.silver, " ⮩ Component Colors : K1 ", inline = "Components", group="STPMT Settings")
i_colorK2 = input(color.silver, "K2 ", inline = "Components", group="STPMT Settings")
i_colorK3 = input(color.silver, "K3 ", inline = "Components", group="STPMT Settings")
i_colorK4 = input(color.silver, "K4 ", inline = "Components", group="STPMT Settings")
i_maLen = input(9 , "Length", minval=1, group="STPMT Moving Average")
i_showCycle = input(false , "On/Off", group="Cycle Indicator")
//------------------------------------------------------------------------------
// stochastic function
f_stoch(_periodK, _smoothK) => sma(stoch(close, high, low, _periodK), _smoothK)
//------------------------------------------------------------------------------
// calculations
k1 = f_stoch(i_periodK1, i_smoothK1)
k2 = f_stoch(i_periodK2, i_smoothK2)
k3 = f_stoch(i_periodK3, i_smoothK3)
k4 = f_stoch(i_periodK4, i_smoothK4)
// La Stochastique Pondérée Moyen Terme (STPMT) or Medium Term Weighted Stochastics calculation
stpmt = (i_weightK1 * k1 +
i_weightK2 * k2 +
i_weightK3 * k3 +
i_weightK4 * k4)
/
(i_weightK1 +
i_weightK2 +
i_weightK3 +
i_weightK4)
stpmt_ma = sma(stpmt, i_maLen) // STPMT Moving Average
cycle = stpmt - stpmt_ma // Cycle Indicator
//------------------------------------------------------------------------------
// plotting
//plot(i_showCycle ? cycle : na, "Cycle Indicator Histogram", cycle > 0 ? color.new(color.green, 34) : color.new(color.red, 34), 1, plot.style_columns) // histogram around zero (0) line
plotcandle(50., 50., 50., i_showCycle ? abs(50. + cycle) : 50., "Cycle Indicator Histogram", cycle > 0 ? color.new(color.green, 34) : color.new(color.red, 34)) // histogram around fifty (50) line
plot(i_data ? k1 : na, "K1", i_colorK1)
plot(i_data ? k2 : na, "K2", i_colorK2)
plot(i_data ? k3 : na, "K3", i_colorK3)
plot(i_data ? k4 : na, "K4", i_colorK4)
plot(stpmt , "STPMT", color.red, 2)
plot(stpmt_ma, "STPMT Moving Average", color.blue, 2)
alertcondition(cross(cycle, 0), title="Trading Opportunity", message="STPMT Cycle : Probable Trade Opportunity\n{{exchange}}:{{ticker}}->\nPrice = {{close}},\nTime = {{time}}")
//------------------------------------------------------------------------------
// test de croix avec des regroupements de stoch
// ce paragraphe sert à mettre des lignes verticales pour repérer, il faut enlever tous les // si tu veux t'en servir
// obLevel1 = input(title="Over Bought Level 1", type=input.integer, defval=90) //Over Bought Level 1
// obLevel2 = input(title="Over Bought Level 2", type=input.integer, defval=85) //Over Bought Level 2
// osLevel1 = input(title="Over Sold Level 1", type=input.integer, defval=10) //Over Sold Level 1
// osLevel2 = input(title="Over Sold Level 2", type=input.integer, defval=15) //Over Sold Level 2
// hline(obLevel1, linestyle=hline.style_solid)
// hline(obLevel2)
// hline(osLevel1, linestyle=hline.style_solid)
// hline(osLevel2)
// ce paragraphe sert pour afficher les parametres de chaque K
Limk2L = input(10,title="Limite k2 Low", group="Limite basse pour croix verte")
Limk3L = input(10,title="Limite k3 Low", group="Limite basse pour croix verte")
Limk4L = input(10,title="Limite k4 Low", group="Limite basse pour croix verte")
LimsmtpL = input(10,title="Limite SMTP Low", group="Limite basse pour croix verte")
signal1 = k2 < Limk2L and k3 < Limk3L and k4 < Limk4L and stpmt < LimsmtpL
plotshape(signal1 ? i_data : na, style=shape.xcross, location=location.absolute, size=size.small, color=color.lime, title="Green cross")
Limk2H = input(80,title="Limite k2 High", group="Limite haute pour croix rouge")
Limk3H = input(80,title="Limite k3 High", group="Limite haute pour croix rouge")
Limk4H = input(80,title="Limite k4 High", group="Limite haute pour croix rouge")
LimsmtpH = input(80,title="Limite SMTP High", group="Limite haute pour croix rouge")
signal2 = k2 > Limk2H and k3 > Limk3H and k4 > Limk4H and stpmt > LimsmtpH
plotshape(signal2 ? i_data : na, style=shape.xcross, location=location.absolute, size=size.small, color=color.red, title="Red cross")
// si tu veux rajouter un croisement de stoch dans les conditions
// signal1 = crossover(stpmt, stpmt_ma) and k2 < Limk2L and k3 < Limk3L and k4 < Limk4L and stpmt < LimsmtpL
// plotshape(signal1 ? i_data : na, style=shape.xcross, location=location.absolute, size=size.small, color=color.lime, title="Green cross")
// signal2 = crossunder(stpmt, stpmt_ma) and k2 > Limk2H and k3 > Limk3H and k4 > Limk4H and stpmt > LimsmtpH
// plotshape(signal2 ? i_data : na, style=shape.xcross, location=location.absolute, size=size.small, color=color.red, title="Red cross")
- j'aime 1
Commentaire
Commentaire