f-cksociety / backtesting-trading-engine-pinecoders

Masterpiece of PineCoders script https://www.tradingview.com/script/dYqL95JB-Backtesting-Trading-Engine-PineCoders/ in v3, this is the project to upgrade it to v4-v5 and implement dynamic variable alerts message from within an indicator() alertcondition as discussed here https://t.me/pinescripters/31982
Mozilla Public License 2.0
9 stars 3 forks source link

v5 needs to touch for ta.change. #5

Closed HeyMrRobot closed 2 years ago

HeyMrRobot commented 2 years ago

As the notice/error suggests,

line 1018: The function 'ta.change' should be called on each calculation for consistency. It is recommended to extract the call from this scope. line 1464: The function 'ta.change' should be called on each calculation for consistency. It is recommended to extract the call from this scope. line 1526: The function 'ta.change' should be called on each calculation for consistency. It is recommended to extract the call from this scope. line 1527: The function 'ta.change' should be called on each calculation for consistency. It is recommended to extract the call from this scope. line 1528: The function 'ta.change' should be called on each calculation for consistency. It is recommended to extract the call from this scope. line 1846: 'alertcondition()' has no effect inside strategies. Script 'BTE v5' has been saved

[backtesting-trading-engine-pinecoders] bte.pine (Lines 1018-1019)


        MinReached := ta.change(MaxReached)? MaxReached : InLong ? math.min(nz(MinReached[1], Rlow), Rlow) : InShort ? math.max(nz(MinReached[1], Rhigh), Rhigh) : na

Open in IDE · Open on GitHub [backtesting-trading-engine-pinecoders] bte.pine (Lines 1464-1465)


    CToCEquityMin := ta.change(CToCEquityMax)? CToCEquityMax : math.min(Equity, nz(CToCEquityMin[1],Equity))

Open in IDE · Open on GitHub [backtesting-trading-engine-pinecoders] bte.pine (Lines 1473-1474)


EquityMin := ta.change(EquityMax)? EquityMax : math.min(InTradeEquity, nz(EquityMin[1]))

Open in IDE · Open on GitHub [backtesting-trading-engine-pinecoders] bte.pine (Lines 1526-1527)


                PEABarToMaxOpp := ta.change(PEAMaxOppReached)? PEABar : PEABarToMaxOpp

Open in IDE · Open on GitHub [backtesting-trading-engine-pinecoders] bte.pine (Lines 1528-1529)


                PEAMaxDrawdown := ta.change(PEAMaxOppReached)? PEAMaxRiskReached : PEAMaxDrawdown

Open in IDE · Open on GitHub

Created from VS Code using CodeStream

HeyMrRobot commented 2 years ago

https://www.tradingview.com/pine-script-reference/v5/#fun_ta%7Bdot%7Dchange