Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

Morun Astro Trend MAs cross Strategy

A Pine Script v4 strategy built on SMA (src, slowMAPeriod), Crossunder (fastMAValues, slowMAValues) and Barssince or Crossunder. It has 6 order rules, 2 entries among them, and trades long and short with the default settings. Exits use a stop loss. Each trade commits 25% of equity and pays 0.1% commission. 11 settings; defaults include Master cycle length 40, Minimum MA cross consolidation period 0 and Hours shift for leading effect 0.

Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.

Does Morun Astro Trend MAs cross Strategy repaint?
Yes
At least one pattern in the source can repaint: intrabar recalculation.
How did Morun Astro Trend MAs cross Strategy do on BTCUSDT 1D with default settings?
Not measured
It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its entry conditions never all held on this data. It closed no trades on the other markets either. A backtest, not investment advice.
Can Morun Astro Trend MAs cross Strategy be converted to Pine Script v5?
Not tested
The steps are shown below, but neither version placed a trade on any market tested, so there was nothing to compare and no download is offered.
Does Morun Astro Trend MAs cross Strategy use a stop loss?
Yes
strategy.exit sets a stop on line 350, 355.
Does Morun Astro Trend MAs cross Strategy run in Zeal Terminal?
Yes
It compiles in 966 ms and runs 1,000 bars in 136 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • Plot
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (11)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$10,000$20,253Equity from $10,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. Lines are what the script plots. The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.
Net profit
0.00%
$0.00
Buy and hold
+102.5%
same period
Closed trades
0
0 won · 0 lost
Profitable
0.0%
of closed trades
Profit factor
—
gross profit ÷ gross loss
Max drawdown
0.00%
$0.00

One run with the author's default settings, $10,000 starting capital, commission as the script sets it. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.

Review

What a careful reader of this script would point out, found by checking the source and the backtest.

  • Note

    No slippage

    Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.

  • Note

    Uses iff(), which v5 removed line 199

    iff() on line 199, 204. v5 writes it as the ternary c ? a : b.

Upgrade and export

Written in Pine Script v4. The upgrade to v5 takes 1 step, one per version, each applied to the result of the one before. A last clean-v5 pass then types the settings and moves when = into if blocks, which v6 requires. Every step runs before and after on the same candles in Zeal Terminal's engine; a step whose results differ is shown but not offered as a download. Upgrades preserve behaviour: bugs are fixed in the Review, never silently here.

  • Upgrading to v5 renames floor → math.floor, sma → ta.sma, tostring → str.tostring, max → math.max, min → math.min, crossover → ta.crossover, barssince → ta.barssince, crossunder → ta.crossunder, avg → math.avg.

v4 → v5

Not verified

Neither version placed a trade on any of the 8 markets, so there was nothing to compare.

  • Line 3: //@version=4 → //@version=5
  • Line 13: input(type = input.integer) → input.int()
  • Line 16: input(type = input.float) → input.float()
  • Line 17: input(type = input.float) → input.float()
  • Line 18: input(type = input.float) → input.float()
  • Line 19: input(type = input.bool) → input.bool()
33 more edits
  • Line 22: input(type = input.bool) → input.bool()
  • Line 23: input(type = input.bool) → input.bool()
  • Line 24: input(type = input.bool) → input.bool()
  • Line 25: input(type = input.string) → input.string()
  • Line 199: iff(c, a, b) → (c ? a : b)
  • Line 203: floor → math.floor
  • Line 204: iff(c, a, b) → (c ? a : b)
  • Line 218: sma → ta.sma
  • Line 233: sma → ta.sma
  • Line 237: sma → ta.sma
  • Line 240: tostring → str.tostring
  • Line 240: tostring → str.tostring
  • Line 240: tostring → str.tostring
  • Line 243: tostring → str.tostring
  • Line 243: tostring → str.tostring
  • Line 247: type is reserved in v5: renamed type_
  • Line 258: tostring → str.tostring
  • Line 260: tostring → str.tostring
  • Line 262: tostring → str.tostring
  • Line 263: tostring → str.tostring
  • Line 264: tostring → str.tostring
  • Line 265: tostring → str.tostring
  • Line 266: tostring → str.tostring
  • Line 295: max → math.max
  • Line 305: min → math.min
  • Line 310: crossover → ta.crossover
  • Line 311: barssince → ta.barssince
  • Line 311: crossunder → ta.crossunder
  • Line 320: crossunder → ta.crossunder
  • Line 321: barssince → ta.barssince
  • Line 321: crossover → ta.crossover
  • Line 358: avg → math.avg
  • Line 360: sma → ta.sma
⋯// © citlacom-// @version=4+// @version=5// Strategy developed by the Financial Astrology Research Group.⋯var int minCrossConsolidationPeriod = input(0, minval=0, step=5, title="Minimum MA cross consolidation period")-var int leadShiftHours = input(0, type=input.integer, minval=0, step=4, title="Hours shift for leading effect")+var int leadShiftHours = input.int(0, minval=0, step=4, title="Hours shift for leading effect")var int futureWeeksNumber = timeframe.isminutes ? 1 : 2// Risk control settings.-float trailingStopPercent = input(10, title="Trailing Stop Distance(%)", type=input.float, minval=0.0, step=1) * 0.01+float trailingStopPercent = input.float(10, title="Trailing Stop Distance(%)", minval=0.0, step=1) * 0.01-float trailingStopTriggerPercent = input(1, title="Trailing Stop Trigger Distance(%)", type=input.float, minval=0.0, step=1) * 0.01+float trailingStopTriggerPercent = input.float(1, title="Trailing Stop Trigger Distance(%)", minval=0.0, step=1) * 0.01-float stopLossPercent = input(5, title="Stop Loss (%)", type=input.float, minval=0.0, step=1) * 0.01+float stopLossPercent = input.float(5, title="Stop Loss (%)", minval=0.0, step=1) * 0.01-bool plotTrailingStop = input(false, title="Plot trailing stop prices.", type=input.bool)+bool plotTrailingStop = input.bool(false, title="Plot trailing stop prices.")string orderType = "market"// Order signals controls.-bool enableEntryShortOrder = input(true, title="Enable entry short orders", type=input.bool)+bool enableEntryShortOrder = input.bool(true, title="Enable entry short orders")-bool enableEntryLongOrder = input(true, title="Enable entry long orders", type=input.bool)+bool enableEntryLongOrder = input.bool(true, title="Enable entry long orders")-bool ignoreEarlyReverseSignal = input(false, title="Ignore exit signal when change is lower than stop loss", type=input.bool)+bool ignoreEarlyReverseSignal = input.bool(false, title="Ignore exit signal when change is lower than stop loss")-string zignalyProviderEnvKey = input("", title="Zignaly provider key environment variable", type=input.string)+string zignalyProviderEnvKey = input.string("", title="Zignaly provider key environment variable")bool skipProcessingFilters = true⋯    timeDiff = candleUnixTime - referenceUnixTime-    iff(timeDiff < 0, na, timeDiff)+    (timeDiff < 0 ? na : timeDiff)getMLSignalCandleIndex(futureWeekOffset) =>⋯    // Day index, days count elapsed from reference date.-    candleIndex = floor(timeDiff / 86400)+    candleIndex = math.floor(timeDiff / 86400)-    iff(candleIndex < 0, na, candleIndex)+    (candleIndex < 0 ? na : candleIndex)getMLSignal(futureWeekOffset) =>⋯    if (smoothPeriod > 0)-        sma(mlSignalSerie, smoothPeriod)+        ta.sma(mlSignalSerie, smoothPeriod)    else⋯calculateFastMA() =>-    sma(hl2, fastMAPeriod)+    ta.sma(hl2, fastMAPeriod)calculateSlowMA() =>⋯    smma = 0.0-    smma := na(smma[1]) ? sma(src, slowMAPeriod) : (smma[1] * (slowMAPeriod - 1) + src) / slowMAPeriod+    smma := na(smma[1]) ? ta.sma(src, slowMAPeriod) : (smma[1] * (slowMAPeriod - 1) + src) / slowMAPeriod    // vwma(hl2, slowMAPeriod)currentDate() =>-    tostring(year) + '-' + tostring(month) + '-' + tostring(dayofmonth)+    str.tostring(year) + '-' + str.tostring(month) + '-' + str.tostring(dayofmonth)    currentTime() =>-    tostring(hour) + ':' + tostring(minute) + ":" + "00"+    str.tostring(hour) + ':' + str.tostring(minute) + ":" + "00"    ⋯    syminfo.timezone-composeSignalData(action, side, type) =>+composeSignalData(action, side, type_) =>    string skipProcessingFiltersString = skipProcessingFilters ? "true" : "false"⋯         '"symbolId":"' + positionSymbolId + '"' + "," +-         '"symbolMinTick":' + tostring(positionSymbolMinTick) + "," ++         '"symbolMinTick":' + str.tostring(positionSymbolMinTick) + "," +         '"exchangeId":"' + exchangeId + '"' + "," +-         '"signalPrice":' + tostring(open) + "," ++         '"signalPrice":' + str.tostring(open) + "," +-         '"indicatorType":"' + type + '"' + "," ++         '"indicatorType":"' + type_ + '"' + "," +-         '"indicatorPeriod":' + tostring(masterCycleLength) + "," ++         '"indicatorPeriod":' + str.tostring(masterCycleLength) + "," +-         '"trailingStopTriggerPercent":' + tostring(trailingStopTriggerPercent * 100) + "," ++         '"trailingStopTriggerPercent":' + str.tostring(trailingStopTriggerPercent * 100) + "," +-         '"trailingStopPercent":' + tostring(trailingStopPercent * 100) + "," ++         '"trailingStopPercent":' + str.tostring(trailingStopPercent * 100) + "," +-         '"trailingStopLongPercent":' + tostring(trailingStopPercent * 100) + "," ++         '"trailingStopLongPercent":' + str.tostring(trailingStopPercent * 100) + "," +-         '"stopLossPercent":' + tostring(stopLossPercent * 100) + "," ++         '"stopLossPercent":' + str.tostring(stopLossPercent * 100) + "," +         '"skipProcessingFilters":' + skipProcessingFiltersString + "," +⋯         '}'-entryLongPosition(type) =>+entryLongPosition(type_) =>-    string alertMessageEntry = composeSignalData("entry", "long", type)+    string alertMessageEntry = composeSignalData("entry", "long", type_)-    strategy.entry("long_entry", strategy.long, comment=type + "EntryLong",+    strategy.entry("long_entry", strategy.long, comment=type_ + "EntryLong",         alert_message=alertMessageEntry)-entryShortPosition(type) =>+entryShortPosition(type_) =>-    string alertMessageEntry = composeSignalData("entry", "short", type)+    string alertMessageEntry = composeSignalData("entry", "short", type_)-    strategy.entry("short_entry", strategy.short, comment=type + "EntryShort",+    strategy.entry("short_entry", strategy.short, comment=type_ + "EntryShort",         alert_message=alertMessageEntry)    -closeLongPosition(type) =>+closeLongPosition(type_) =>-    string alertMessage = composeSignalData("exit", "long", type)+    string alertMessage = composeSignalData("exit", "long", type_)    bool executeExit = ignoreEarlyReverseSignal ? (entryPriceShortDiff >= stopLossPercent or entryPriceLongDiff >= trailingStopTriggerPercent) : true    if (executeExit)-        strategy.close("long_entry", comment= type + "ExitLong", alert_message=alertMessage)+        strategy.close("long_entry", comment= type_ + "ExitLong", alert_message=alertMessage)-closeShortPosition(type) =>+closeShortPosition(type_) =>-    string alertMessage = composeSignalData("exit", "short", type)+    string alertMessage = composeSignalData("exit", "short", type_)    bool executeExit = ignoreEarlyReverseSignal ? (entryPriceLongDiff >= stopLossPercent or entryPriceShortDiff >= trailingStopTriggerPercent) : true    if (executeExit)-        strategy.close("short_entry", comment=type + "ExitShort", alert_message=alertMessage)+        strategy.close("short_entry", comment=type_ + "ExitShort", alert_message=alertMessage)// Calculate long trailing stop.⋯        stopValue = baseStopPrice * (1 - stopFactor)-        max(stopValue, longStopPrice[1])+        math.max(stopValue, longStopPrice[1])    else⋯        stopValue = baseStopPrice * (1 + stopFactor)-        min(stopValue, shortStopPrice[1])+        math.min(stopValue, shortStopPrice[1])    else⋯checkMACrossUpper(fastMAValues, slowMAValues) =>-    bool maCross = crossover(fastMAValues, slowMAValues)+    bool maCross = ta.crossover(fastMAValues, slowMAValues)-    int underCrossConsolidationPeriod = barssince(crossunder(fastMAValues, slowMAValues))+    int underCrossConsolidationPeriod = ta.barssince(ta.crossunder(fastMAValues, slowMAValues))    bool minCrossConsolidationPass = underCrossConsolidationPeriod >= minCrossConsolidationPeriod⋯checkMACrossLower(fastMAValues, slowMAValues) =>-    bool maCross = crossunder(fastMAValues, slowMAValues)+    bool maCross = ta.crossunder(fastMAValues, slowMAValues)-    int overCrossConsolidationPeriod = barssince(crossover(fastMAValues, slowMAValues))+    int overCrossConsolidationPeriod = ta.barssince(ta.crossover(fastMAValues, slowMAValues))    bool minCrossConsolidationPass = overCrossConsolidationPeriod >= minCrossConsolidationPeriod⋯// Thanks to "Sol" trader that contributed the idea of rescaling ML daily trend signal to price.-realOHLC = avg(open, high, low, close)+realOHLC = math.avg(open, high, low, close)priceSignalSmoothPeriod = calculateDayBarsCount() * 2-smoothRealPrice = priceSignalSmoothPeriod > 0 ? sma(realOHLC, priceSignalSmoothPeriod) : na+smoothRealPrice = priceSignalSmoothPeriod > 0 ? ta.sma(realOHLC, priceSignalSmoothPeriod) : napriceSignal = smoothRealPrice * mlSignalSerieSmooth⋯

Clean v5

Not verified

Neither version placed a trade on any of the 8 markets, so there was nothing to compare.

  • Line 11: input() → input.int()
  • Line 12: input() → input.int()
⋯// Signals indicators.-var int masterCycleLength = input(40, minval=30, step=10, title="Master cycle length")+var int masterCycleLength = input.int(40, minval=30, step=10, title="Master cycle length")-var int minCrossConsolidationPeriod = input(0, minval=0, step=5, title="Minimum MA cross consolidation period")+var int minCrossConsolidationPeriod = input.int(0, minval=0, step=5, title="Minimum MA cross consolidation period")var int leadShiftHours = input.int(0, minval=0, step=4, title="Hours shift for leading effect")⋯

Does it run in Pine Script v6?

Not tested

Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © citlacom-// @version=5+// @version=6// Strategy developed by the Financial Astrology Research Group.⋯

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
Master cycle length40int · min 30 · step 10fastMAPeriod slowMAPeriod signalData
Minimum MA cross consolidation period0int · min 0 · step 5minCrossConsolidationPass
Hours shift for leading effect0int (written input.integer) · min 0 · step 4leadShiftSeconds
Trailing Stop Distance(%)10float · min 0.0 · step 1signalData stopFactor
Trailing Stop Trigger Distance(%)1float · min 0.0 · step 1trailingStopLongTrigger trailingStopShortTrigger signalData executeExit
Stop Loss (%)5float · min 0.0 · step 1signalData executeExit stopFactor
Plot trailing stop prices.falseboolLong Trail Stop Short Trail Stop
Enable entry short orderstrueboolline 327
Enable entry long orderstrueboolline 316
Ignore exit signal when change is lower than stop lossfalseboolexecuteExit
Zignaly provider key environment variablestringsignalData

What it calculates

  • SMA (sma, ta.sma in v5)src, slowMAPeriodsmma · line 237
  • Crossunder (crossunder, ta.crossunder in v5)fastMAValues, slowMAValuesmaCross · line 320
  • Barssince / Crossunder (barssince, ta.barssince in v5)crossunder(fastMAValues, slowMAValues)underCrossConsolidationPeriod · line 311
  • Barssince / Crossover (barssince, ta.barssince in v5)crossover(fastMAValues, slowMAValues)overCrossConsolidationPeriod · line 321
  • SMA (sma, ta.sma in v5)realOHLC, priceSignalSmoothPeriodsmoothRealPrice · line 360

Signal flow

How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.

masterCycleLengthMaster cycle lengthsetting · 40highhighprice datalowlowprice dataclosecloseprice dataleadShiftHoursHours shift for leading…setting · 0timetimeprice datahl2hl2price datastopLossPercentStop Loss (%)setting · 5trailingStopTriggerPercentTrailing Stop Trigger D…setting · 1trailingStopPercentTrailing Stop Distance(…setting · 10openopenprice dataminCrossConsolidationPeriodMinimum MA cross consol…setting · 0smmaSMA→ smmamaCrossCrossunder→ maCrossunderCrossConsolidationPeriodBarssince / Crossunder→ underCrossConsolidationPeri…overCrossConsolidationPeriodBarssince / Crossover→ overCrossConsolidationPeriodsmoothRealPriceSMA→ smoothRealPricefutureWeeksNumber, currentPositionSize, currentPositionEntryPrice, positionSymbol, positionSymbolId, positionSymbolMinTick, exchangeId, entryName, futureOffsetSeconds, timeDiff, candleIndex, dayBarsOffset, skipProcessingFiltersString, alertMessageEntryfutureWeeksNumber · cur…14 valuesfastMAPeriod, slowMAPeriodfastMAPeriod · slowMAPe…2 valuesentryPriceLongDiffentryPriceLongDiffvalueentryPriceShortDiffentryPriceShortDiffvaluebaseStopPricebaseStopPricevalueleadShiftSecondsleadShiftSecondsvaluereferenceUnixTimereferenceUnixTimevaluecandleUnixTimecandleUnixTimevalueitemsCountitemsCountvalueindexindexvaluefutureWeekBarsOffset, mlSignalLeadSerie, plotOffsetfutureWeekBarsOffset · …3 valuesdayIndexdayIndexvaluemlSignalSerieSmooth, todayMLSignal, tomorrowMLSignalmlSignalSerieSmooth · t…3 valuessrcsrcvalueexecuteExitexecuteExitvaluestopFactorstopFactorvaluestopValuestopValuevaluerealOHLCrealOHLCvaluepriceSignalpriceSignalvalueignoreNewSignalignoreNewSignalconditiontrailingStopLongTriggertrailingStopLongTriggerconditiontrailingStopShortTriggertrailingStopShortTriggerconditionmlSignalmlSignalconditionsignalsignalconditionminCrossConsolidationPassminCrossConsolidationPa…conditionmlTrendLong, mlTrendShortmlTrendLong · mlTrendSh…2 conditionsentry:long_entryOpen long_entrystrategy.entryentry:short_entryOpen short_entrystrategy.entryclose:long_entryClose long_entrystrategy.closeclose:short_entryClose short_entrystrategy.closeexit:long_exitexit long_exitstrategy.exitexit:short_exitexit short_exitstrategy.exitplot:333plotplotplot:334plotplotplot:339Long Trail Stopplotplot:343Short Trail Stopplotplot:363plotplotbgcolor:366bgcolorbgcolor

Order rules

OrderFires whenBy defaultLine
Open long_entry longevery barOn272
Open short_entry shortevery barOn276
Close long_entry(executeExit)On283
Close short_entry(executeExit)On288
Exit long_exit stop(currentPositionSize > 0)On350
Exit short_exit stop(currentPositionSize < 0)On355

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Does it repaint?

Yes

At least one pattern in the source can repaint; it is marked Check below.

Not measuredNo trades to compareThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, but neither the live nor the historical run produced any trades in them, so the replay says nothing either way.
  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • CheckIntrabar recalculationuses varip. Live values can differ from history.
  • ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.

The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.

Other markets

The same script with default settings on 8 Binance markets. Each row is a separate backtest over the most recent 1,000 bars.

MarketNetBuy and holdTradesWonProfit factorMax drawdownPeriod
BTCUSDT 1D0.0%+102.5%00%—0.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h0.0%+5.5%00%—0.0%8 May 2026 – 21 Oct 2026
ETHUSDT 1D0.0%+9.8%00%—0.0%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h0.0%+8.4%00%—0.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D0.0%+16.7%00%—0.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h0.0%+21.5%00%—0.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D0.0%+148.3%00%—0.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h0.0%+17.1%00%—0.0%8 May 2026 – 21 Oct 2026

Backtests are simulations on historical data and are not investment advice.

Similar scripts

Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.

ScriptSharesTypeNetTradesMax drawdown
Morun Astro Trend MAs cross Strategy this page—v4 strategy0.0%00.0%
Last Price minus Open Price Intraday Volume by avsr90barssince smav5 strategyNo trades on this market
Bollinger Bands Strategy with Intraday Intensity Index by SparkyFlarysma barssincev4 strategy−0.2%2530.6%
AlphaTrend Strategy by only_fibonaccisma barssincev5 strategy−1.4%244.2%
PresentTrend - Strategy [presentTrading] by PresentTradingsma barssincev5 strategy−0.0%126.1%
pomila by cryptostartegysma barssincev4 strategy−54.6%2586.6%

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 966 msWith a workaround 1,000 bars in 136 msNot measured
PineTSNo v5 and v6 only—Not measured

The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.

“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report. PineTS runs Pine Script v5 and v6 only.

Source

Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.

// 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.strategy("Financial Astrology Research MA Strategy",      overlay=true, linktoseries=true,     currency="USD", pyramiding=0, initial_capital=10000,     default_qty_type=strategy.percent_of_equity, default_qty_value=25,     commission_type=strategy.commission.percent, commission_value=0.1)// Signals indicators.var int masterCycleLength = input(40, minval=30, step=10, title="Master cycle length")var int minCrossConsolidationPeriod = input(0, minval=0, step=5, title="Minimum MA cross consolidation period")var int leadShiftHours = input(0, type=input.integer, minval=0, step=4, title="Hours shift for leading effect")var int futureWeeksNumber = timeframe.isminutes ? 1 : 2// Risk control settings.float trailingStopPercent = input(10, title="Trailing Stop Distance(%)", type=input.float, minval=0.0, step=1) * 0.01float trailingStopTriggerPercent = input(1, title="Trailing Stop Trigger Distance(%)", type=input.float, minval=0.0, step=1) * 0.01float stopLossPercent = input(5, title="Stop Loss (%)", type=input.float, minval=0.0, step=1) * 0.01bool plotTrailingStop = input(false, title="Plot trailing stop prices.", type=input.bool)string orderType = "market"// Order signals controls.bool enableEntryShortOrder = input(true, title="Enable entry short orders", type=input.bool)bool enableEntryLongOrder = input(true, title="Enable entry long orders", type=input.bool)bool ignoreEarlyReverseSignal = input(false, title="Ignore exit signal when change is lower than stop loss", type=input.bool)string zignalyProviderEnvKey = input("", title="Zignaly provider key environment variable", type=input.string)bool skipProcessingFilters = truebool exitOnReverseSignal = trueint fastMAPeriod = masterCycleLength / 2int slowMAPeriod = masterCycleLength// Position information.float currentPositionSize = strategy.position_sizefloat currentPositionEntryPrice = strategy.position_avg_pricestring positionSymbol = syminfo.tickerstring positionSymbolId = syminfo.tickeridfloat positionSymbolMinTick = syminfo.mintickstring exchangeId = syminfo.prefixstring entryName = strategy.position_entry_namebool ignoreNewSignal = currentPositionSize != 0// Trailing stop trigger checks.float entryPriceLongDiff = 1 - (currentPositionEntryPrice[1] / high)float entryPriceShortDiff = 1 - (low / currentPositionEntryPrice[1])bool trailingStopLongTrigger = entryPriceLongDiff > trailingStopTriggerPercentbool trailingStopShortTrigger = entryPriceShortDiff > trailingStopTriggerPercent// Trailing stop calculation base price.float baseStopPrice = trailingStopLongTrigger or trailingStopShortTrigger ? close : currentPositionEntryPrice// 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[] ADA = array.from(     1,0,1,1,1,1,1,1,0,0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,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,1,1,0,1,1,0,0,0,1,1,0,1,0,1,1,1,0,0,1,0,0,1,1,0,1,1,1,0,0,1,1,1,0,0,1,1,1,1,1,0,0)var mlSignal = if (syminfo.ticker == "ADAUSDT")    ADAelse if (syminfo.ticker == "BATUSDT")    BATelse if (syminfo.ticker == "BNBUSDT")    BNBelse if (syminfo.ticker == "BTCUSDT")    BTCelse if (syminfo.ticker == "DASHUSDT")    DASHelse if (syminfo.ticker == "EOSUSDT")    EOSelse if (syminfo.ticker == "ETCUSDT")    ETCelse if (syminfo.ticker == "ETHUSDT")    ETHelse if (syminfo.ticker == "LINKUSDT")    LINKelse if (syminfo.ticker == "LTCUSDT")    LTCelse if (syminfo.ticker == "XLMUSDT")    XLMelse if (syminfo.ticker == "XRPUSDT")    XRPelse if (syminfo.ticker == "ZECUSDT")    ZECelse if (syminfo.ticker == "ZRXUSDT")    ZRXelse    array.from(0)    scaleBetween(unscaledNum, minAllowed, maxAllowed, min, max) =>  (maxAllowed - minAllowed) * (unscaledNum - min) / (max - min) + minAllowedcalculateDayBarsCount() =>    // Daily resolution    if (timeframe.period == "D")        1    // 4 hours    else if (timeframe.period == "240")        6    // 3 hours    else if (timeframe.period == "180")        8    // 2 hours    else if (timeframe.period == "120")        12    // 1 hour    else if (timeframe.period == "60")        24    // 45 minutes    else if (timeframe.period == "45")        32    // 30 minutes    else if (timeframe.period == "30")        48    // 15 minutes    else if (timeframe.period == "15")        96    // 10 minutes    else if (timeframe.period == "10")        144    // 5 minutes    else if (timeframe.period == "5")        288    // For other resolutions don't plot future predictions.    else        0calculateWeekBarsCount(numWeeks) =>    dayBarsCount = calculateDayBarsCount()    numWeeks * 7 * dayBarsCountcalculateCandleTimeDiff(futureWeekOffset) =>    // 2021-01-01 00:00 ML signal day time serie start.    leadShiftSeconds = leadShiftHours * 3600    futureOffsetSeconds = calculateWeekBarsCount(futureWeekOffset) > 0         ? futureWeekOffset * 7 * 86400         : 0    referenceUnixTime = 1609459200 - futureOffsetSeconds - leadShiftSeconds    candleUnixTime = (time / 1000) + 1    timeDiff = candleUnixTime - referenceUnixTime    iff(timeDiff < 0, na, timeDiff)getMLSignalCandleIndex(futureWeekOffset) =>    timeDiff = calculateCandleTimeDiff(futureWeekOffset)    // Day index, days count elapsed from reference date.    candleIndex = floor(timeDiff / 86400)    iff(candleIndex < 0, na, candleIndex)getMLSignal(futureWeekOffset) =>    // Map array data items indexes to candles.    int candleIndex = getMLSignalCandleIndex(futureWeekOffset)    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        nacalculateSmoothSignal(mlSignalSerie) =>    int smoothPeriod = calculateWeekBarsCount(1)    if (smoothPeriod > 0)        sma(mlSignalSerie, smoothPeriod)    else        nagetCurrentDayMLSignal(mlSignal, dayOffset) =>    futureWeekBarsOffset = calculateWeekBarsCount(futureWeeksNumber)    dayBarsOffset = calculateDayBarsCount() * dayOffset    dayIndex = futureWeekBarsOffset - dayBarsOffset    mlSignal[dayIndex]// Compose signal time serie from array data, N weaks lead signals for future projection (plot offset).int mlSignalLeadSerie = getMLSignal(futureWeeksNumber)// Scale smooth signal into price -/+ 20% price range.float mlSignalSerieSmooth = scaleBetween(calculateSmoothSignal(mlSignalLeadSerie),  0.8, 1.2, 0, 1)int todayMLSignal = getCurrentDayMLSignal(mlSignalLeadSerie, 0)int tomorrowMLSignal = getCurrentDayMLSignal(mlSignalLeadSerie, 1)calculateFastMA() =>    sma(hl2, fastMAPeriod)calculateSlowMA() =>    src = hl2    smma = 0.0    smma := na(smma[1]) ? sma(src, slowMAPeriod) : (smma[1] * (slowMAPeriod - 1) + src) / slowMAPeriod    // vwma(hl2, slowMAPeriod)currentDate() =>    tostring(year) + '-' + tostring(month) + '-' + tostring(dayofmonth)    currentTime() =>    tostring(hour) + ':' + tostring(minute) + ":" + "00"    currentTimezone() =>    syminfo.timezonecomposeSignalData(action, side, type) =>    string skipProcessingFiltersString = skipProcessingFilters ? "true" : "false"    string signalData = '{' +         '"date":"' + currentDate() + '"' + "," +         '"hour":"' + currentTime() + '"' + "," +         '"timezone":"' + currentTimezone() + '"' + "," +         '"orderType":"' + orderType + '"' + "," +         '"action":"' + action + '"' + "," +         '"side":"' + side + '"' + "," +         '"symbolCode":"' + positionSymbol + '"' + "," +         '"symbolId":"' + positionSymbolId + '"' + "," +         '"symbolMinTick":' + tostring(positionSymbolMinTick) + "," +         '"exchangeId":"' + exchangeId + '"' + "," +         '"signalPrice":' + tostring(open) + "," +         '"indicatorType":"' + type + '"' + "," +         '"indicatorPeriod":' + tostring(masterCycleLength) + "," +         '"trailingStopTriggerPercent":' + tostring(trailingStopTriggerPercent * 100) + "," +         '"trailingStopPercent":' + tostring(trailingStopPercent * 100) + "," +         '"trailingStopLongPercent":' + tostring(trailingStopPercent * 100) + "," +         '"stopLossPercent":' + tostring(stopLossPercent * 100) + "," +         '"skipProcessingFilters":' + skipProcessingFiltersString + "," +         '"providerEnvKey":"' + zignalyProviderEnvKey + '"' +         '}'entryLongPosition(type) =>    string alertMessageEntry = composeSignalData("entry", "long", type)    strategy.entry("long_entry", strategy.long, comment=type + "EntryLong",         alert_message=alertMessageEntry)entryShortPosition(type) =>    string alertMessageEntry = composeSignalData("entry", "short", type)    strategy.entry("short_entry", strategy.short, comment=type + "EntryShort",         alert_message=alertMessageEntry)    closeLongPosition(type) =>    string alertMessage = composeSignalData("exit", "long", type)    bool executeExit = ignoreEarlyReverseSignal ? (entryPriceShortDiff >= stopLossPercent or entryPriceLongDiff >= trailingStopTriggerPercent) : true    if (executeExit)        strategy.close("long_entry", comment= type + "ExitLong", alert_message=alertMessage)closeShortPosition(type) =>    string alertMessage = composeSignalData("exit", "short", type)    bool executeExit = ignoreEarlyReverseSignal ? (entryPriceLongDiff >= stopLossPercent or entryPriceShortDiff >= trailingStopTriggerPercent) : true    if (executeExit)        strategy.close("short_entry", comment=type + "ExitShort", alert_message=alertMessage)// Calculate long trailing stop.calculateTrailingStopLong() =>    longStopPrice = 0.0    stopFactor = trailingStopLongTrigger ? trailingStopPercent : stopLossPercent    longStopPrice := if (currentPositionSize > 0)        stopValue = baseStopPrice * (1 - stopFactor)        max(stopValue, longStopPrice[1])    else        0    longStopPrice// Calculate short trailing stop.calculateTrailingStopShort() =>    shortStopPrice = 0.0    stopFactor = trailingStopShortTrigger ? trailingStopPercent : stopLossPercent    shortStopPrice := if (currentPositionSize < 0)        stopValue = baseStopPrice * (1 + stopFactor)        min(stopValue, shortStopPrice[1])    else        9999999    shortStopPricecheckMACrossUpper(fastMAValues, slowMAValues) =>    bool maCross = crossover(fastMAValues, slowMAValues)    int underCrossConsolidationPeriod = barssince(crossunder(fastMAValues, slowMAValues))    bool minCrossConsolidationPass = underCrossConsolidationPeriod >= minCrossConsolidationPeriod    bool mlTrendLong = todayMLSignal == 1 and tomorrowMLSignal >= 1    if (exitOnReverseSignal and maCross)        closeShortPosition("MA")    if (enableEntryLongOrder and maCross and minCrossConsolidationPass and mlTrendLong)        if (not ignoreNewSignal)            entryLongPosition("MA")checkMACrossLower(fastMAValues, slowMAValues) =>    bool maCross = crossunder(fastMAValues, slowMAValues)    int overCrossConsolidationPeriod = barssince(crossover(fastMAValues, slowMAValues))    bool minCrossConsolidationPass = overCrossConsolidationPeriod >= minCrossConsolidationPeriod    bool mlTrendShort = todayMLSignal == 0 and tomorrowMLSignal == 0    if (exitOnReverseSignal and maCross)        closeLongPosition("MA")        if (enableEntryShortOrder and maCross and minCrossConsolidationPass and mlTrendShort)        if (not ignoreNewSignal)            entryShortPosition("MA")// Strategy MAs line plots.fastMAValues = calculateFastMA()slowMAValues = calculateSlowMA()plot(fastMAValues, color=color.lime, style=plot.style_line, linewidth=3)plot(slowMAValues, color=color.orange, style=plot.style_line, linewidth=2)checkMACrossUpper(fastMAValues, slowMAValues)checkMACrossLower(fastMAValues, slowMAValues)// Plot trailing stop price marks.longStopPrice = calculateTrailingStopLong()plot(series=(currentPositionSize > 0 and plotTrailingStop) ? longStopPrice: na,     color=color.fuchsia, style=plot.style_cross,     linewidth=2, title="Long Trail Stop")shortStopPrice = calculateTrailingStopShort()plot(series=(currentPositionSize < 0 and plotTrailingStop) ? shortStopPrice : na,     color=color.fuchsia, style=plot.style_cross,     linewidth=2, title="Short Trail Stop")// ISSUE NOTE: When strategy.exit is invoked through a function the alert_message // results in empty data. Keep the call at main script level.if (currentPositionSize > 0)    string alertMessage = composeSignalData("exit", "long", "SL")    strategy.exit("long_exit", "long_entry", comment="TSLExitLong",         alert_message=alertMessage, stop=longStopPrice)// Submit exit orders for short position trailing stop.if (currentPositionSize < 0)    string alertMessage = composeSignalData("exit", "short", "SL")    strategy.exit("short_exit", "short_entry", comment="TSLExitShort",         alert_message=alertMessage, stop=shortStopPrice)// Thanks to "Sol" trader that contributed the idea of rescaling ML daily trend signal to price.realOHLC = avg(open, high, low, close)priceSignalSmoothPeriod = calculateDayBarsCount() * 2smoothRealPrice = priceSignalSmoothPeriod > 0 ? sma(realOHLC, priceSignalSmoothPeriod) : napriceSignal = smoothRealPrice * mlSignalSerieSmoothint plotOffset = calculateWeekBarsCount(futureWeeksNumber)plot(priceSignal, color=color.aqua, style=plot.style_line, linewidth=2, offset=plotOffset)//plot(todayMLSignal, color=color.silver, style=plot.style_cross, linewidth=1)// Mark future predictions boundary.bgcolor(barstate.islast ? color.new(color.silver, 60) : na)