This is the low level function GValueXX is created from try the LangSub and LangFunc API call to use these.
SetBuiltInVar -- Subroutine
Sets the value of a built-in Variable. Passes the variable number '0' to '254' and the value of the variable as a variant.
There are 255 built-in variables that that can be set using this function. They will remain set for the duration of a backtesting session. The variable is stored between runs of the 'mom series'.
Return type
A Variant value
Syntax
SetBuiltInVar(Num as Integer,Value as Variant )
This code shows a good example of using this function with GetBuiltInVar to write a custom report that outputs a row to the custom report when a 10-day momentum crosses to positive from negative.
Sub Scanner(SLen)
Dim CellRow as Integer
If Close>CloseΗ] amd CloseΏ] then
CellRow=GetBuiltInVar(0)+1
SetTextValue(GetActiveSymbol(0),CellRow,1,30)
SetTextValue(FormatDateTime(date),CellRow,2,10)
SetTextValue("Uptrend for tomorrows trade ",CellRow,3,40)
SetBuiltInVar(0,CellRow)
End if
End sub
|