User Variables V#.

Login or Register

Please login or register in order to view and post in the Forum.

4 posts / 0 new
Last post
shixin121
Last seen: 4 years 11 months ago
Joined: 03/08/2019 - 00:47
User Variables V#.

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.

0
Eddy_F
Last seen: 2 days 19 hours ago
Joined: 07/30/2014 - 16:18
Shixin,

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

cpayne
Last seen: 1 year 1 month ago
Joined: 03/30/2009 - 00:00
User Variable > Usage Report

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.

shixin121
Last seen: 4 years 11 months ago
Joined: 03/08/2019 - 00:47
Thank you.

Thank you.