I am working on porting an indicator in 2008 issue of S&C to NinjaTrader because the two versions of it I have found online are not returning valid values.
In looking through the TradersStudio code, he uses something called GValues.... they look like variables, but he doesn't declare them... or assign an initial value. He just starts using them.
First he declares then sets 0 as the value in a handful of arrays:
For N = 0 To 60
I[N] = 0
OldI[N] = 0
OlderI[N] = 0
Q[N] = 0
OldQ[N] = 0
OlderQ[N]=0
Real[N] = 0
OldReal[N] = 0
OlderReal[N] = 0
Imag[N] = 0
OldImag[N] = 0
OlderImag[N] = 0
Ampl[N] = 0
OldAmpl[N] = 0
DB[N] = 0
OldDB[N] = 0
color[N] = 0
Next
Then he sets a couple other variables:
price = (H+L)/2
delta = 0.1
fuzzRGB = 190
lineRGB = 255
TScurrentBar = CurrentBar + 1
myDate = FormatDateTime(Date)
Then this block appears:
I = GValue201
OldI = GValue202
OlderI = GValue203
Q = GValue204
OldQ = GValue205
OlderQ = GValue206
Real = GValue207
OldReal = GValue208
OlderReal = GValue209
Imag = GValue210
OldImag = GValue211
OlderImag = GValue212
Ampl = GValue213
OldAmpl = GValue214
DB = GValue215
OldDB = GValue216
But he hasn't declared these GValues, so am confused what they are.
Then the calcs are done, and at the end, last code block before End Function, This block appears:
GValue201 = I
GValue202 = OldI
GValue203 = OlderI
GValue204 = Q
GValue205 = OldQ
GValue206 = OlderQ
GValue207 = Real
GValue208 = OldReal
GValue209 = OlderReal
GValue210 = Imag
GValue211 = OldImag
GValue212 = OlderImag
GValue213 = Ampl
GValue214 = OldAmpl
GValue215 = DB
GValue216 = OldDB
Which looks like he is resetting the arrays.
The program would then start over again on the next bar.
So WTH are GValues? He declares and assigns values to all other variables, but they sure look like variables.
In looking through the TradersStudio code, he uses something called GValues.... they look like variables, but he doesn't declare them... or assign an initial value. He just starts using them.
First he declares then sets 0 as the value in a handful of arrays:
For N = 0 To 60
I[N] = 0
OldI[N] = 0
OlderI[N] = 0
Q[N] = 0
OldQ[N] = 0
OlderQ[N]=0
Real[N] = 0
OldReal[N] = 0
OlderReal[N] = 0
Imag[N] = 0
OldImag[N] = 0
OlderImag[N] = 0
Ampl[N] = 0
OldAmpl[N] = 0
DB[N] = 0
OldDB[N] = 0
color[N] = 0
Next
Then he sets a couple other variables:
price = (H+L)/2
delta = 0.1
fuzzRGB = 190
lineRGB = 255
TScurrentBar = CurrentBar + 1
myDate = FormatDateTime(Date)
Then this block appears:
I = GValue201
OldI = GValue202
OlderI = GValue203
Q = GValue204
OldQ = GValue205
OlderQ = GValue206
Real = GValue207
OldReal = GValue208
OlderReal = GValue209
Imag = GValue210
OldImag = GValue211
OlderImag = GValue212
Ampl = GValue213
OldAmpl = GValue214
DB = GValue215
OldDB = GValue216
But he hasn't declared these GValues, so am confused what they are.
Then the calcs are done, and at the end, last code block before End Function, This block appears:
GValue201 = I
GValue202 = OldI
GValue203 = OlderI
GValue204 = Q
GValue205 = OldQ
GValue206 = OlderQ
GValue207 = Real
GValue208 = OldReal
GValue209 = OlderReal
GValue210 = Imag
GValue211 = OldImag
GValue212 = OlderImag
GValue213 = Ampl
GValue214 = OldAmpl
GValue215 = DB
GValue216 = OldDB
Which looks like he is resetting the arrays.
The program would then start over again on the next bar.
So WTH are GValues? He declares and assigns values to all other variables, but they sure look like variables.
