Hi,
OK. I will post my ticket here just to get something happening.
I am trying to do a simple peak-detector-with-reset (code below). There are 3 IF()s in the code. The code fails on the third IF() (the associated 'plot' variable disappears of the screen is the only symptom). There is self-referentiality in the 1st IF() that works fine. The code is accepted by the compiler as valid. There's nothing obviously wrong with the 3rd IF().
PRETRADE = SWITCH( ((NDTOT[1] <= 0.0) AND (NDTOT[0] > NDTOT[1])), NDTOT[0] < NDTOT[1]); BUY = PRETRADE[0] and (PRETRADE[1] <= 0); BUY_PRICE = if(BUY[1] > 0, open(), BUY_PRICE); ND = COUNTMATCHSINCESIGNAL( 1 , BUY); PROFIT = close() - BUY_PRICE; GO = if(ND <= 1, 1.000, close()/BUY_PRICE); Gad = 1.0 + (GO - 1)/ND; Gad_max = if(Gad > Gad_max, Gad, Gad_max);
I have tried to see if other functions in the language can do what I want. They don't seem to be useful for this, but maybe I've missed something. All I want is to capture and maintain the maximum in Gad (called Gad_max) and reset it when GO is reset to 1 (happens because of the BUY single-day pulse).
I can't see why the script doesn't work.
cheers
colin
(happy to issue a ticket on this if you want, when the system works)