If there are multiple studies recording data into one V#, in the following cases, which case will be true?
1. Reporting error.
2. Cumulate all value into summation.
3. One value replaces all values recorded from other studies.
Thank you.
If there are multiple studies recording data into one V#, in the following cases, which case will be true?
1. Reporting error.
2. Cumulate all value into summation.
3. One value replaces all values recorded from other studies.
Thank you.
Shixin,
check my answer to your other thread as a custom indicator with MPD tokens is most likely what you need -
Anyhow the V#1 value will always store the value as per the last execution of a SET(V#1, ..) statement or the last "record" action (if using the corresponding checkbox in a CI setup window)
However, for the record, it is possible to accumulate data in a V#1
Lets say you have a signal marker on a chart (syntax of the SIGNAL being CL > MA) and you want to count how many time it does trigger on a day since the start of the session
SET(V#1, V#1+(CL>MA)) will provide such information LIVE, but without keeping any history
If you want to create an historical counter (that could be display as a study on a chart and not only provide the latest value, then you need to create a custom indicator with a syntax such as
SUM(CL>MA,POS) with POS = number of bar since start of session
or use the SSTAT token (Signal statistics) with the count signal option...
Eddy
If you go to File > Preferences > User Variables and click the Usage Report button, that may help uncover multiple sources setting the same user variable.
Thank you.