long term portfolio backtesting with many symbols

Questions about MultiCharts and user contributed studies.
User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

long term portfolio backtesting with many symbols

Postby joebone » 16 Feb 2019

Hello all,

I am experimenting with portfolio backtester.

I have some symbols that are newer and some that are older. If a symbol isn't trader yet but I have it in the backtester and use its close value in a calculation then I assume it will fubar with a division by zero or something.

I came from Thinkscript on ToS. When I have a variable that is "Not a Number" for part of the calculation then I can scrub that data by saying

def variable1 = close("ticker")
def clean_variable1 = if isnan(variable1) then clean_varibale1 = 1 else clean_variable1 = variable1;

is this type of coding applicable in Powerlanguage?

thanks

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: long term portfolio backtesting with many symbols

Postby Henry MultiСharts » 22 Feb 2019

Hello joebone,

If there is no data for a symbol yet, then that won't be possible to run any code over it in your Portfolio.


Return to “MultiCharts”