Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © citlacom
- // @version=4
- // Strategy developed by the Financial Astrology Research Group.
- study(title="Financial Astrology Indexes ML Daily Trend", shorttitle="AstroIndexesMLDailyTrend")
- var int futureWeeksNumber = input(1, type=input.integer, minval=0, step=1, title="Future weeks prediction to display in the plot")
- // Due to TradingView limitations to integrate external signals from financial astrology ML models
- // we needed to hardcode the buy/sell signals here in the code as PineScript array with start Date index at 2021-01-01
- // and end index at 2022-12-31, this signal is based on the correlation of planets cycles and price trend for each research
- // asset historical data detected through machine learning methods, once models are trained can forecast future daily trend.
- varip int[] DJI = array.from(
- 0,0,1,1,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,1,1,0,1,1,1,0,1,1,0,1,0,1,1,1,1,0,1,1,0,1,1,1,1,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0,1,1,0,1,0,0,1,0,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,0,1,0,1,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,
- 1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,1,0,0,1,1,1,1,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0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1,1,1,0,0,0,1,1,0,0,1,0,1,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,1,0,1,1,0,
- 1,0,1,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,0,1,0,1,1,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,1,0,0,1,0,1,1,1,1,0,1,1,1,1,0,1,1,0,0,1,1,0,0,1,0,1,0,0,1,1,1,1,0,0,0,0,1,0,1,1,0,1,1,0,1,0,0,1,1,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,0,1,1,1,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,1,0,1,0,1,1,0,1,1,0)
- varip mlSignal = if (syminfo.ticker == "DJI")
- DJI
- else if (syminfo.ticker == "UK100")
- FTSE
- else if (syminfo.ticker == "SPX")
- GSPC
- else if (syminfo.ticker == "GLD")
- GLD
- else if (syminfo.ticker == "IBC")
- IBEX
- else if (syminfo.ticker == "IXIC")
- IXIC
- else if (syminfo.ticker == "NI225")
- N225
- else if (syminfo.ticker == "BANKNIFTY")
- NSEBANK
- else if (syminfo.ticker == "NIFTY")
- NSEI
- else
- array.from(0)
- calculateWeekBarsCount(numWeeks) =>
- // Daily resolution
- if (timeframe.period == "D")
- numWeeks * 5
- // Hourly resolution
- else if (timeframe.period == "60")
- numWeeks * 5 * 7
- // 2 hours
- else if (timeframe.period == "120")
- numWeeks * 5 * 4
- // 3 hours
- else if (timeframe.period == "180")
- numWeeks * 5 * 3
- // 4 hours
- else if (timeframe.period == "240")
- numWeeks * 5 * 2
- // For other resolutions don't plot future predictions.
- else
- 0
- calculateCandleTimeDiff() =>
- // 2021-01-01 00:00 ML signal day time serie start.
- futureOffsetSeconds = calculateWeekBarsCount(futureWeeksNumber) > 0 ? futureWeeksNumber * 7 * 86400 : 0
- referenceUnixTime = 1609459200 - futureOffsetSeconds
- candleUnixTime = (time / 1000) + 1
- timeDiff = candleUnixTime - referenceUnixTime
- iff(timeDiff < 0, na, timeDiff)
- getMLSignalCandleIndex() =>
- timeDiff = calculateCandleTimeDiff()
- // Day index, days count elapsed from reference date.
- candleIndex = floor(timeDiff / 86400)
- iff(candleIndex < 0, na, candleIndex)
- getMLSignal() =>
- // Map array data items indexes to candles.
- int candleIndex = getMLSignalCandleIndex()
- int itemsCount = array.size(mlSignal)
- // Return na for candles where indicator data is not available.
- int index = candleIndex > itemsCount ? na : candleIndex
- signal = if (index >= 0 and itemsCount > 1)
- array.get(mlSignal, index)
- else
- na
- calculateSmoothSignal(mlSignalSerie) =>
- int smoothPeriod = calculateWeekBarsCount(1)
- if (smoothPeriod > 0)
- sma(mlSignalSerie, smoothPeriod)
- else
- na
- // Compose signal time serie from array data.
- int mlSignalSerie = getMLSignal()
- // Calculate plot offset estimating market week open days
- int plotOffset = calculateWeekBarsCount(futureWeeksNumber)
- // Plot astrology ML daily trend prediction.
- float mlSignalSerieSmooth = calculateSmoothSignal(mlSignalSerie)
- plot(iff(mlSignalSerie == 1, 1, na), color=color.green, style=plot.style_cross, linewidth=2, offset=plotOffset)
- plot(iff(mlSignalSerie == 0, 0, na), color=color.red, style=plot.style_cross, linewidth=2, offset=plotOffset)
- plot(mlSignalSerieSmooth, color=color.yellow, style=plot.style_line, linewidth=2, offset=plotOffset)
- // Highlight today prediction.
- todayStart = timestamp(syminfo.timezone, year(timenow), month(timenow), dayofmonth(timenow), 00, 00, 00)
- bgcolor((time >= todayStart) ? color.new(color.silver, 50) : na)
Advertisement
Add Comment
Please, Sign In to add comment