I am trying to write a formula that uses another symbol as a reference. I am not sure how to look up the close price of that other symbol.
Is there a method that does that?
My specific problem is that I would like to revise the chande_trendscore to take a symbol as an arguement.
result = cFunctions.CompileFormula("a = iff(close>=Ref(close,11),1,-1)+iff(close>=Ref(close,12),1,-1)+iff(close>=Ref(close,13),1,-1)+iff(close>=Ref(close,14),1,-1)+iff(close>=Ref(close,15),1,-1)+iff(close>=Ref(close,16),1,-1)+iff(close>=Ref(close,17),1,-1)+iff(close>=Ref(close,18),1,-1)+iff(close>=Ref(close,19),1,-1)+iff(close>=Ref(close,20),1,-1);").GetVectorDouble("a");
Actually, I shouldn't have closed this issue so quickly...
There is still a problem... when you pass symbol_parameter this way and compile the function, it compiles ok but does not work as expected. The value passed at runtime is not seen when the function runs. Is that because it is being concatenated into the string instead of passed as a parameter? Should QSFormula.SetParameter be overloaded to accept VectorS? It currently only accepts VectorD so I can't test to see if that would fix the problem.
Did you get the first or any value of the symbol parameter?
The parameter that is passed is a String Vector.
Also do not forget the single quote before and after the double quotes.