This code draws arrows to highlight Short Swing points and circles to highlight Intermediate Swing Points.
Whoever knows the book “Long-term secrets to short-term trading” will know how to use these points.
Blue skies!!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
//computation of the radius to draw ellipses radius=average[200](range)/4 //formula to compute short term swing points if (high>alto[1]) and not (high<high[1] and low>low[1]) then alto=high basso=low markup=barindex markhigh=high endif if (low<basso[1]) and not (high<high[1] and low>low[1]) then alto=high basso=low markdown=barindex marklow=low endif if alto<alto[1] and trend=1 then trend=0 drawarrowdown(markup,markhigh) mediummarkup=shortmarkup shortmarkup=markup longmarkhigh=mediummarkhigh mediummarkhigh=shortmarkhigh shortmarkhigh=markhigh //intermediate high swing points if longmarkhigh<mediummarkhigh and mediummarkhigh>shortmarkhigh then DRAWELLIPSE(mediummarkup-1, mediummarkhigh-radius, mediummarkup+1, mediummarkhigh+radius) endif endif if basso>basso[1] and trend=0 then trend=1 drawarrowup(markdown,marklow) mediummarkdown=shortmarkdown shortmarkdown=markdown longmarklow=mediummarklow mediummarklow=shortmarklow shortmarklow=marklow //intermediate low swing points if longmarklow>mediummarklow and mediummarklow<shortmarklow then DRAWELLIPSE(mediummarkdown-1, mediummarklow-radius, mediummarkdown+1, mediummarklow+radius) endif endif drawcandle(open,high,low,close) return |
Share this
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 :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Gran bel lavoro Gabri, il libro di Larry Williams merita tanto.
Sarebbe possibile sviluppare un sistema automatico con questo indicatore, che compri e venda in automatico? Che ne pensi?
Sarebbe un’ottima base di partenza 🙂
Al,
ci posso provare ma non so quando…mi sta nascendo una bimba a giorni 🙂 me lo segno e appena posso ci iniziero’ a lavorare.
Grazie mille, e auguri per il lieto evento 🙂
Superbe indicateur ,tu peux créer un SCREENER qui sélectionne les actions avec les points et les cercles à l’ achat ?
I will try to do the screener in a week or so
Una domanda Gabri: io ho il libro ma non capisco a quale capitolo tu ti riferisca.
Grazie per la condivisione e la risposta nonchè auguri per la bimba che si chiamerà?…..
cool gabri, thank you 🙂
maspap, sono le pagine dalla 13 alla 32 della seconda edizione in inglese, il nome e’ Chiara.
thx a lot gabri, good work
Ciao gabri
piccolo problema con le ellissi che vengono ridipinte (disegnare quindi cancellare) in base alle quotazioni future.
laurodegann,
le ellissi vengono dipinte quando viene rilevato un intermediate swing point that is a swing point with a higher swing point right and left (in case of a intermediate low swing point). The drawing of the circle happens with delay but this is normal
Mais il peut aussi disparaître lorsque il y a un retournement contraire……..je les tester en timeframe 5mn. Les flèches sont correctement dessinés .les ellipses sont dessinées bien plus tard parfois 4 ou 5 ou 10 chandeliers plus tard et peuvent disparaître aussi rapidement qu’elles ont été dessiné….
Mais c’est un bon code quand même ……cela me fait penser au code STO qui fonctionne sur les futures cotations.Mais qui repeint..
Donc a prendre avec modération..
ciao
I have never seen the ellipsis disappearing but I will check again the code. When the condition to draw the ellipsis remain the ellipsis is drawn and can disappear only when the initial condition is lost, meaning when a candle is changed because represented wrong. All the indicators and strategies have to be taken with moderation…that is why trading is risky 🙂
J’ ai testé en daily et Hebdo , l’ ellipse ne disparaît pas ,en revanche se qui est dommage ,je trouve aucune flêche en Daily sous la dernière bougie a la clôture .
c’est normal ou pas ? Dans ce cas on prend position une journée en retard !!!
To form an arrow, say for a high, you need a candle with a lower high the day prior and a lower high the day after (and no inside days). You are right, you need to wait the day after the high to see the arrow appearing but this is part of the strategy Williams uses. ALL the indicators of the world are lagging, the simple price is lagging because is the result of a transaction that happened in the past. Using Williams’ strategy you actually enter weeks after a Intermediate swing point….and you still make profit.
Si j’ ai bien compris ,tes points d’ entrée et tes sorties. quand tu as un point bas avec une ellipse,tu achète et quand tu as un point haut avec une ellipse , tu vend ?
In a dime, if you want to go long you wait to intermediate swing points to form (ellipsis), with second one higher than the first one. You enter at the high of the previous day candle. This strategy is meant for daily trading. You should read the book to get better info, unfortunately I cannot shrink an entire paragraph in a few lines.
pour l’ entrée ,j’ ai bien compris ,mais la sortie de position ? même si j’ achète le livre ,se serai bien que tu détaille la base de la méthode avec l’ indicateur . Merci gabri
You can use the same system you used for the entry but reversed or use a target profit or use a trailing stop on the short swing points.
OK ,donc j’ attend la prochaine ellipse et je coupe la position .
This is one way.
Someone asked for a screener based on William’s Highs and Lows, Here’s one:
// Wlliams’ Swingpoint Screener
// 18-11-2017
// Violet
// Method uses price patterns exclusively
// Therefore no parameters required
trend = 1 // Assume initial trend is UP
// Highs and lows of the bars/candles
Insidebar = high low[1]
if not Insidebar and high > mhi[1] then
mhi = high
mlo = low
endif
if not Insidebar and low < mlo[1] then
mhi = high
mlo = low
endif
// Trend reversal?
if trend = 1 and mhi mlo[1] then
trend = 1 // Swing Up
endif
c1 = trend crosses over trend[1]
c2 = trend crosses under trend[1]
screener [ c1 or c2 ] sort by trend
The upload process inexplicable mangled the program above. Here is another try:
trend = 1 // Assume initial trend is UP
// Highs and lows of the bars/candles
Insidebar = high low[1]
if not Insidebar and high > mhi[1] then
mhi = high
mlo = low
endif
if not Insidebar and low < mlo[1] then
mhi = high
mlo = low
endif
// Trend reversal?
if trend = 1 and mhi mlo[1] then
trend = 1 // Swing Up
endif
c1 = trend crosses over trend[1]
c2 = trend crosses under trend[1]
screener [ c1 or c2 ] sort by trend
Again it mangles the source code. This line should replace the ‘Inside Bar’ test:
Insidebar = high low[1]
Also this block should replace the ‘Trend reversal’ section,
// Trend reversal?
if trend = 1 and mhi mlo[1] then
trend = 1 // Swing Up
endif
Moderator, why is the code repeatedly mangled during the upload process?
It happened again. I call it quits.
il faut que le screener ,sorte toutes les actions avec signal d’ achat ( flêche ellipse )
flêche ,avec ellipse
Gabri,
Congratulation and very good job. One of the best indicators I’ve seen so far. ;))))
Thanks a lot Juan, I just coded what Williams created 🙂
Can somebody help me to code this in another way. I want no arrow at the barindex. i want sth like a=1 for DRAWARROWUP and a=2 for DRAWELLIPSE. I tried it, but i changed the indicator… :/
write in line 3 and 4ppp=0
qqq=0 and change the command drawarrow with ppp=1 and the command drawellipse with qqq=2.
At the end add return ppp,qqq
write in line 3 and 4
ppp=0
qqq=0
and change the command drawarrow with ppp=1 and the command drawellipse with qqq=2.
At the end add return ppp,qqq
Very good job and and way to automatice trades? instead drawcircle or arrows buy or sell??? im trying but i cant
Yes Gabri, is there any way we can replace the command drawarrow or drawellipse for a command to buy or sell and change the indicator into an strategy?? Thanks so much.
I have uploaded a screener (in the screener section) that hopefully does what you are asking for. It is currently under review, so if there no problems you will soon be able to use it.
Hi all, I just had a baby and I pretty busy these days to enjoy this moments and to get some sleep 🙂 I will try to make a code to automatic trade, and/or a screener, but I don’t know when.
Cool!!! So, Nicolas is reviewing it and when is OK he will display it in the screener Section?? Under which name?? In any case, thanks so much Violet
I named it ‘Williams Swing Points’.
Thanks, looking forward to checking it out!!!!
Hi Gabri, I’m going to read the book but I ask you to give me a suggestion about how to use the indicator, if it’s possible. Thank you!
For long entries you enter as soon as a intermediate low swing point (the ellipsis) is formed above the prior intermediate low swing point. You normally exit based on timings, profit or trailing stop. The author explains also an exit based on the following rule:
1. Take the difference between the highest intermediate high swing point and the lowest low before your entry
2 add this value to the intermediate high swing point used in point 1 and this is the target price
Hello Gabri,
how woud you make this code in a automated strategy? for example just to buy on low swing point ellipsis and short on high swing point ellipsis ?
Abz,
some indicators work really well with automated trading (AT) and some don’t. This, in my opinion, it’s not the best for AT because of its complexity. The post above yours describes the entry setup suggested by Williams and, as you can see, it’s not the easiest to code and to run smoothly for all the commodities. Probably with stronger coding softwares it would be easier but PRT has some limits that make this indicator difficult to use with AT. This is just my opinion though, I don’t AT.
Gabri, I tweaked the “Williams Highs and Lows” indicator by:
(1) Visually pointing to the candle where a Larry Williams pattern setup is actually completed, and becomes valid, and
(2) indicating the actual entry point on that particular candle
Look at this code: drawtext(“▾”,barindex,low[1]-ticksize/3, dialog,bold,20)
Small Unicode triangles are used.
By doing so, people are no longer confused as to *when* and at *what price* the actual entry/exit points occur.
The arrows and ellipses are drawn on past candles, but no sooner and only then when the actual completion points are flagged. The signs (arrow, ellipse and triangle) mark both the start and the finish of the price pattern. A pattern comprises a minimum of two candles, but sometimes several more than that. People tend not to understand this.
The suggestion is to replace the existing indicator in the library with this updated one.
Here is the code:
//computation of the radius to draw ellipses
radius=average[200](range)/4
//formula to compute short term swing points
Insidebar = high low[1]
if ( high > alto[1]) and not insidebar then
alto = high
basso = low
markup = barindex
markhigh = high
endif
if ( low < basso[1]) and not insidebar then
alto = high
basso = low
markdown = barindex
marklow = low
endif
if alto < alto[1] and trend = 1 then
trend = 0
mediummarkup = shortmarkup
shortmarkup = markup
longmarkhigh = mediummarkhigh
mediummarkhigh = shortmarkhigh
shortmarkhigh = markhigh
//intermediate high swing points
if longmarkhigh shortmarkhigh then
DRAWELLIPSE(mediummarkup -1 , mediummarkhigh – radius, mediummarkup + 1, mediummarkhigh+radius)
else
drawarrowdown(markup,markhigh) coloured(255,0,0)
drawtext(“▾”,barindex,low[1]-ticksize/3, dialog,bold,20)
// Sellpoint = low[1] – ticksize
endif
endif
if basso > basso[1] and trend = 0 then
trend = 1
mediummarkdown = shortmarkdown
shortmarkdown = markdown
longmarklow = mediummarklow
mediummarklow = shortmarklow
shortmarklow = marklow
//intermediate low swing points
if longmarklow > mediummarklow and mediummarklow < shortmarklow then
DRAWELLIPSE(mediummarkdown – 1, mediummarklow – radius, mediummarkdown + 1, mediummarklow + radius)
else
drawarrowup(markdown,marklow) coloured(0,0,255)
drawtext("▴",barindex,high[1]+ticksize/3, dialog,bold,20)
// Buypoint = high[1] + ticksize
endif
endif
//drawcandle(open,high,low,close)
return 1
Violet, great job. I also came up with this possible code:
Hi Gabri,
Do I have to have certain features on to have the arrows etc drawn on the charts.
Regards
Jae
You get an arrow when a new short term high/low is defined (without inside days). You get a circle when an intermediate hi/low is spotted.
Hi Violet,
Nice code. There are some signs missing. Would you mind to tell? Thanks.
Line 5:
//formula to compute short term swing points
Insidebar = high ? low[1]
Line 27:
//intermediate high swing points
if longmarkhigh ? shortmarkhigh then
I have been trying to compute a code out of this, but it didnt work, so I am very interested in your modifications.
Nice work,
Juan
Juan, you can find the missing codes/signs in Gabri’s algorithm. They have not changed since then. Due to error that occur when uploading a program, the signs are dropped in a mysterious way.
Hi Gabi,
You are right. I filled the blanks from the original code, but there is a new part you have included (Insidebar), and I am just missing the first statement “Insidebar = high ? low[1]”. I have tried >, <, and =, but it seems like is not working. I just got a line as indicator.
Thanks, Juan
Sorry, I meant Violet
//computation of the radius to draw ellipses
radius=average[200](range)/4
//if golong=1 then
//golong=0
//endif
//formula to compute short term swing points
if (high>alto[1]) and not (highlow[1]) then
alto=high
basso=low
markup=barindex
markhigh=high
endif
if (low<basso[1]) and not (highlow[1]) then
alto=high
basso=low
markdown=barindex
marklow=low
endif
if alto<alto[1] and trend=1 then
trend=0
drawarrowdown(markup,markhigh)
mediummarkup=shortmarkup
shortmarkup=markup
longmarkhigh=mediummarkhigh
mediummarkhigh=shortmarkhigh
shortmarkhigh=markhigh
//intermediate high swing points
if longmarkhighshortmarkhigh then
DRAWELLIPSE(mediummarkup-1, mediummarkhigh-radius, mediummarkup+1, mediummarkhigh+radius)
oldlongellipse=newlongellipse
newlongellipse=mediummarkhigh
if newlongellipsebasso[1] and trend=0 then
trend=1
drawarrowup(markdown,marklow)
mediummarkdown=shortmarkdown
shortmarkdown=markdown
longmarklow=mediummarklow
mediummarklow=shortmarklow
shortmarklow=marklow
//intermediate low swing points
if longmarklow>mediummarklow and mediummarklowoldshortellipse then
DRAWSEGMENT(barindex-1, high[1], barindex+5, high[1]) coloured (0,0,250)
endif
endif
endif
drawcandle(open,high,low,close)
return
I forgot, the red lines are the enter prices for short positions and the blue lines the enter prices for long positions. I would suggest to add some percentage of ATR to this entry levels and to confirm with volumes at least.
Hello Gabri and Violet , is it possible to post the code in full on a new forum tread? there are som missing parts her and there on both codes in this thread.
Bonsoir Gabri,
Merci pour votre fabuleux indicateur.
C’est le premier indicateur que j’utilise avec lequel j’ai réalisé que des trades gagnants jusqu’à présent.
Encore merci.
You are welcome!!!
Do you use a particular screener for Williams Higs et Lows ?
Violet and I came up with a possible screener in the comments above
RolanBay, L’ellipse apparaît-elle à la bougie notifiée et reste ?
Is this screener of Violet ? “Trend reversal and continuation patterns” where no?
This is the one I suggested
if (high>alto[1]) and not (highlow[1]) then
alto=high
basso=low
markup=barindex
markhigh=high
endif
if (low<basso[1]) and not (highlow[1]) then
alto=high
basso=low
markdown=barindex
marklow=low
endif
if altoimhighnew then
refhigh=mediummarkup
endif
endif
if basso>basso[1] and trend=0 then
trend=1
mediummarkdown=shortmarkdown
shortmarkdown=markdown
longmarklow=mediummarklow
mediummarklow=shortmarklow
shortmarklow=marklow
//intermediate low swing points
if longmarklow>mediummarklow and mediummarklow<shortmarklow then
imlowold=imlownew
imlownew=mediummarklow
//reflow=shortmarkdown
endif
if imlowoldimhighnew and (highest[barindex-refhigh+1](high))<=mediummarkhigh
screener[c1 and not c2] (c1)
And you can find Violet’s screener here
https://www.prorealcode.com/prorealtime-market-screeners/williams-swing-points/
I get an assignment error? but where ?
Je n’ai pas compris
Bonsoir,
J’observe avec grand plaisir que vous parlez mieux français que moi!!!
Simplement, je reçois un message d’erreur d’assignation lorsque je lance mon screener.
J’utilise google translator mais j’étudie le français pur 8 ans à l’école 🙂 que dit l’erreur?
Erreur de syntaxe dans l’assignation
Ok, this website cuts lines of code, let me see what I can do
I just sent the screener code to be reviewed and published. As soon as it gets released I will post the link.
OK merci beaucoup
Here the link for the screener https://www.prorealcode.com/prorealtime-market-screeners/screener-williamss-highs-lows/
Yessss! ce coup-ci est le bon. Formidable, merci beaucoup.
Bonjour Rolanbay .
tu peux détailler ta méthode de trading avec l’ indicateur et le screener.tu applique un money management ?
Cordialement .
C’est très simple. D’abord je suis novice. Ensuite je je recherche uniquement sur tendance haussière, j’utilise le screener de Gabri, puis un backtest de Doctrading pour les stratégies.
Le résultat me semble plus que prometteur. Bonne soirée.
rolanbay ,j’ ai bien compris ,mais tes points d’ entrée a l’ achat ,et de vente par rapport au flêches de l’ indicateur ?
J’entre au moment de l’oscillation haussière consécutive à une forte baisse le tout en tendance haussière, je place un stoploss quand l’oscillation baissière apparait.
Bonjour Gabri,
Auriez-vous la stratégie qui correspond à l’indicateur Williams’ Highs and Lows ?
You enter long when an intermediate low swing point is made (ellipsis) and you exit at target price or trailing stop.
Think you
Cette stratégie permet de conforter les choix avec votre indicateur :
// Taille des positions
// Valable pour un capital de 10.000 euros à chaque position,
// pour les actions
capital = 10000+strategyprofit
n = capital / close
n = round(n)
// Daéfinition de la TENDANCE par les moyennes mobiles
// Sur le PEA, on ne fait qu’ACHETER, et qu’en phase haussière
MMlongue = average[200](close)
MMmoyenne = average[80](close)
MMcourte = average[45](close)
// CONDITIONS POUR OUVRIR UNE POSITION ACHETEUSE
a1 = MMcourte > MMmoyenne and MMmoyenne > MMlongue
a2 = MMlongue > MMlongue[13] and MMmoyenne > MMmoyenne[13] and MMcourte > MMcourte[13]
a3= (average[2] crosses under average[5](close))
IF a1 and a2 and a3 THEN
BUY n shares AT MARKET
ENDIF
// CONDITIONS POUR FERMER UNE POSITION ACHETEUSE
v1 = (average[2] CROSSES over average[10](close))
IF v1 THEN
SELL AT MARKET
ENDIF
merci
Buenos Días,
¿podrias indicarme el libro de referencia de la estrategia?
Gracias.
The book is “long term secret to short term trading”
https://www.prorealcode.com/topic/williams-indicator/
link strategy by Nicolas
Buongiorno, ho poca esperienza e volevo chiedere se è possibile creare un trading system che usi questa tecnica, che vada long e short seguendo le frecce dell’indicatore.
Buongiorno è possibile creare un trading system automatico che segua questo indicatore ? cioè quindi che va long o short in base alla freccia che compare ? non sono esperto e spero che qualcuno mi possa aiutare. Grazie
Gianni, io non faccio trading automatico ma sono sicuro che Nicolas ti potra’ aiutare.
Bonjour, Savez-vous à combien de bougies après apparaît l’ellipse ? Il faut faire attention, elle n’apparaît pas tout de suite.
scusa Gagry ma il programm da copiare è quello con tutte le modifiche di cui ho letto nei vari post..oppure bisgona copiare pezzi in giro e rifarlo da soli..? grazie mille!
bonjour a tous , superbe travail
j’aimerai si possible une indication pour modifier l’indicateur pour n’avoir que les entrées flèches noires + flèches noires avec ellipses et que les flèches avec ellipses ( de sorties ) je ne souhaiterais pas avoir celles sans
serait t’il aussi possible d’avoir un screener qu’avec les positions à l’achat (flèches noires + flèches noires avec ellipses )
d’avance merci cordialement