Strategy doesn't retrieve correct index
Author: Assenzio
Creation Date: 7/14/2011 10:12 AM
profile picture

Assenzio

#1
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.
profile picture

Cone

#2
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.
profile picture

Assenzio

#3
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 !
profile picture

Cone

#4

... 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.
profile picture

Assenzio

#5
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.
profile picture

Cone

#6
DatesMode, Events, etc., have no definition, so I'd say the problem must be in the part you haven't shown us.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).