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

v3 to v4 upgrade errors #1

Closed HeyMrRobot closed 2 years ago

HeyMrRobot commented 2 years ago

Compiling script... Script 'BTE PineCoders' has been compiled Processing script... line 1303: The function 'change' should be called on each calculation for consistency. It is recommended to extract the call from this scope. line 1592: Shadowing variable 'RoundToTick1' which exists in parent scope. Did you want to use the ':=' operator instead of '=' ? line 1593: Shadowing variable 'RoundToTick2' which exists in parent scope. Did you want to use the ':=' operator instead of '=' ? line 1783: The function 'change' should be called on each calculation for consistency. It is recommended to extract the call from this scope. line 1854: The function 'change' should be called on each calculation for consistency. It is recommended to extract the call from this scope. line 1855: The function 'change' should be called on each calculation for consistency. It is recommended to extract the call from this scope. line 1856: The function 'change' should be called on each calculation for consistency. It is recommended to extract the call from this scope. line 2119: The transp argument will be deprecated soon. We recommend using color.new() or color.rgb() functions to specify the transparency of the plots instead. line 2120: The transp argument will be deprecated soon. We recommend using color.new() or color.rgb() functions to specify the transparency of the plots instead. Script 'BTE PineCoders v4' has been saved

Converted script with errors > https://github.com/f-cksociety/backtesting-trading-engine-pinecoders/blob/main/bte-v4-wip.pine Assignees: @HeyMrRobot Labels: upgrade,compile

HeyMrRobot commented 2 years ago

When add to char it gives maximum plot error as well.

Study Error Maximum number of output series (64) was reached. Script contains 65. image

HeyMrRobot commented 2 years ago

It was upgraded to v5 but the suggestions on the function remaining as,

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

I will make an pull request and link the issue with it