How to use i_getplotvalue and i_setplotvalue to compare two signals on chart?
Hi, how would I go about using i_getplotvalue (or i_setplotvalue) to compare two signals as they go about plotting a chart throughout the trading day and have rules to execute a buy or sell? I haven't been able to find much example code or documentation on using these two functions and any help/advice would be much appreciated. Thank you!
I am afraid, but it's not really clear to me what you are trying to do exactly or why i_getplotvalue / i_setplotvalue would be needed.
The Multicharts wiki clarifies and gives an example on how to use these two reserved words and this should be enough to get you going.
I wanted to use i_getplotvalue to compare two signals, where if one signal was greater than the other then for a trade to be executed or have some kind of indicator placing a colored dot for example but I was not sure how to get the index portion working on the function. I am not sure how to go about populating the index ->
The example give is: plot1(i_getplotvalue(111), "MaxIDDrawdown");
Where 111 is the index value. But I would like this function to be constantly running as the two signals are turned on during the trading day so the index would be constantly changing no?
You need to look into i_setplotvalue for setting the value that you want to receive with i_getplotvalue. They can only work in conjunction. One way to do it would be sending strategy values to an indicator.
I don't understand why the index would change in the example you gave, it should never change, but remain constant. Think of it like a frequency you use for broadcasting something. If you'd constantly change your frequency, your listeners (the indicators) would have a hard time tuning in.