BeardedQuant

Pinbar (30-50 Rule)

My first script to identify pin bars with a predefined rules, any feedbacks are welcome.

Rules

Bullish Candle

1. Body of the candle should be above the 50% of the day's price range

AND

2. Either the open or the close should be above the 30% of the day's price range

if both the above conditions are met then a bullish arrow is produced with "B".

Bearish Candle

1. Body of the candle should be below the 50% of the day's price range

AND

2. Either the open or the close should be below the 30% of the day's price range

if both the above conditions are met then a bearish arrow is produced with "S".

Thanks

Hope this indicator helps you identify trading entries.
Script de código aberto

No verdadeiro espírito TradingView, o autor deste script o publicou com código aberto, para que os traders possam compreendê-lo e verificá-lo. Um brinde ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para utilizá-lo em um gráfico.

Quer usar esse script no gráfico?

Comentários

How do I appy this to a forex chart in Trading View?
Resposta
Adding the below two lines would result create an alert whenever the above rule is satisfied.

alerts = (bearishpin or bullishpin)
alertcondition(alerts,"PinBar","PinbBar")

Though user has to add the alert to the market they want it to be. Alert can be added by

Paste the two line code to the script of Pinbar (30-50) script, then add it to chart of the market of your preference
Then go to alert section on the right (second option from the top)
Then add to alert or create new alert

In condition dropdown you should see your market name, change that pinbar then in the next section automatically it should change to PinBar if not select it.

Then you can choose how you want the alert to be per your own choice with your own message etc. I have created this alert to give me one signal and not specific buy or sell signal. You can split the code to do that easily.

Hope this helps
Resposta