I'm going mad ... why this script doesn't work properly ? I mean it plots correctly the INDEX series but in the BUY/SELL loop it doesn't retrieve the correct INDEX data and so I have wrong buy signals. Is it a problem of synch since the SPXADV series have less history than the primary one (SPX) ?
CODE:
Please log in to see this code.
Size:
Color:
I'd say clearing the Bars.Cache would probably give you fits with using series that are stored there. I'd do that after processing the loop, not in the loop.
Size:
Color:
Okay, I tried, but this does not resolve. I think it depends on the synch. Because since the SPX have more history the buy signal flagged even before the INDEX dataseries begins !
Size:
Color:
... actually, that can't be it would have its own "SPXADV" cache.
This looks potentially bad: BuyAtClose(bar+Entrata.ValueInt.. if Entrata is anything but 0 or 1
After that, I won't look at this again without having a complete script to work with so I don't have to waste time guessing.
Size:
Color:
Entrata.ValueInt it is zero ... the whole code is too complicated to be posted. I'll try by myself on how to find a turnaround. Thank you anyway.
Size:
Color:
DatesMode, Events, etc., have no definition, so I'd say the problem must be in the part you haven't shown us.
Size:
Color: