A precise picture of the short-term price swings is basic to understanding the market direction. The Clear method is an effective way to identify and visualize short-term price swings. The method benefits the individual trader because it is simple, objective, requires no calculation, and has no delay.
This indicator is the implementation of the swing line indicator presented in Ron Black’s article in this issue (“Getting Clear With Short-Term Swings”).
Code converted from TradeStation programming language by a request in the English forum.
//PRC_SwingLine Ron Black | indicator
//20.09.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
if upsw=1 then
if high>hH then
hH=high
endif
if low>hL then
hL=low
endif
if high<hL then
upsw=0
lL=low
lH=high
endif
endif
if upsw=0 then
if low<lL then
lL=low
endif
if high<lH then
lH=high
endif
if low>lH then
upsw=1
hH=high
hL=low
endif
endif
if upsw=1 then
swingline=hL
r=0
g=255
b=255
else
swingline=lH
r=255
g=0
b=255
endif
return swingline coloured(r,g,b) style(line,2) as "Swing Line"
You must be logged in to post a comment.
I'm reffering to the first code you posted here...after that, someone has add a ponderate average (sorry...in italian called media mobile MM) but I don't need it... I would like that you can modify for me the original code indicator you posted:)... Thanks
Nicolas...loving this indicator that you have created!!! Thanks for sharing with everyone! I'm not a profectional indicator's builder...can you please, when you have time, insert a link here of this indicator (your original version with no MM) but with the signal for long/short enter indicated with the bars below the graphic...green to buy and red to sell...like the one you created for the divergences...I know that someone already asked for it and you have answered him, but following that instructions I'm not able to modify it correctly...if it is not a disturb! Thanks so much! And another request...don't hate me:)....how can I indicated, inside a TS, to go long only if this indicator is setting in long way(coloured blu) or short if it indicates to go short(coloured pink)? Thanks again
Bonjour, Je n'arrive pas à faire fonctionner cet indicateur? Quel est le bon code dans sa totalité? Merci
//PRC_SwingLine Ron Black | indicator //20.09.2017 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge if upsw=1 then if high>hH then hH=high endif if low>hL then hL=low endif if high<hL then upsw=0 lL=low lH=high endif endif if upsw=0 then if low<lL then lL=low endif if highlH then upsw=1 hH=high hL=low endif endif if upsw=1 then swingline=hL r=0 g=255 b=255 swup=1 swdwn=0 else swingline=lH r=255 g=0 b=255 swup=0 swdwn=-1 endif return swingline coloured(r,g,b) style(line,2) as "Swing Line",swup,swdwn
Just add the r and g variables to the return instruction and you'll get the information of the current color (r or g would be equal to 255 if the actual trend is bearish or bullish, otherwise it would be equal to 0): return swingline coloured(r,g,b) style(line,2) as "Swing Line", r, g
Hi Nicolas, (me again) Can you please clarify the following. maOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriod maClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriod maLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriod maHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriod I'm trying to understand where/what these figures are derived from. Starting from O,H,L,C figures. maOpen(1) (what does the (1) signify, and is Maperiod -1 essentially the setting "maperiod less1? trying to match the numbers on PRT. Can you please help with this one? Thanks Matt
Hi Nicolas, the Swing Line Indicator translate by You seems to be good. I thought that it can be used into a screener, simply replacing the "swingline" output variable with the "upsw" as output variable. Then, it can be built a new screener that gives the ticker which shows a change from 0 to 1 or from 1 to 0, simply comparing current candle with the previous one. I added code for Your review, if You like. Ciao
Questo è il codice completo, perché mancavano delle righe di codice, nella versione di Supertiti. Ho anche cambiato i colori. // SLRB SwingLine Ron Black PRC indicator modified Supertiti 20.09.2017 //Nicolas @ http://www.prorealcode.com Sharing ProRealTime knowledge if upsw=1 then if high>hH then hH=high endif if low>hL then hL=low endif if high<hL then upsw=0 lL=low lH=high endif endif if upsw=0 then if low<lL then lL=low endif if highlH then upsw=1 hH=high hL=low endif endif if upsw=1 then swingline=hL r=0 g=0 b=255 else swingline=lH r=255 g=0 b=0 endif maSL = average [p,m](swingline) return maSL coloured (r,g,b) as " maSwingLine " , customclose as " customeclose SLRB " // swingline coloured(r,g,b) style(line,3) as "Swing Line" , // Variables : // p = 20 entier // m = Matype = pondérée
// SLRB SwingLine Ron Black PRC indicator 20.09.2017 //Nicolas @ www.prorealcode.com Sharing ProRealTime knowledge if upsw=1 then if high>hH then hH=high endif if low>hL then hL=low endif if high<hL then upsw=0 lL=low lH=high endif endif if upsw=0 then if low<lL then lL=low endif if highlH then upsw=1 hH=high hL=low endif endif if upsw=1 then swingline=hL r=255 g=228 b=196 else swingline=lH r=255 g=0 b=55 endif maSL = average [p,m](swingline) return maSL coloured (r,g,b) as " maSwingLine " , customclose as " customeclose SLRB " // swingline coloured(r,g,b) style(line,3) as "Swing Line" , // Variables : // p = 20 entier // m = Matype = pondérée
Hi Nicolas Hope all is well your side, do you have a specific strategy for the MFT Swing Line indicator Alert?