Hello:
I am trying to combine 2 indicators into 1: the 1st script is a standard price study that colors the bars red or green depending on the current trend, and is invoked on each trade, this script then attempts to call the DTI Directional Trend Index as a function (on BARSTATE_NEWBAR) that returns either a 1 or 2 depending on trend direction according to that indicator. I would then like to compare the results of the 2 indicators. The problem is that the vRef = ref(-1) from the DTI code is always undefined.
Does the Ref(-1) command not work when called in a function?
Also...Is "not-defined" the same thing as "null"?
I am trying to combine 2 indicators into 1: the 1st script is a standard price study that colors the bars red or green depending on the current trend, and is invoked on each trade, this script then attempts to call the DTI Directional Trend Index as a function (on BARSTATE_NEWBAR) that returns either a 1 or 2 depending on trend direction according to that indicator. I would then like to compare the results of the 2 indicators. The problem is that the vRef = ref(-1) from the DTI code is always undefined.
Does the Ref(-1) command not work when called in a function?
Also...Is "not-defined" the same thing as "null"?
Comment