gahankaripradyumna

find bulish patterns

In this script:

We continue to calculate the bullish engulfing condition for monthly candlesticks (engulfingConditionM) as before.

We then create two variables (engulfingConditionY and lastYear) to calculate the yearly engulfing condition.

We use an if statement to check if the year has changed compared to the previous bar. If it has, we update the engulfingConditionY variable; otherwise, we keep the previous year's value.

Finally, we plot the monthly and yearly signals on the chart.

This code allows you to work with monthly data and calculate yearly signals based on the monthly data available in TradingView. Please note that this is an approximation and not true yearly resolution data, but it's a common workaround used in TradingView Pine Script.
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva 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 usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?