Hi guys,
I have a problem with one indicator in my chart. Looking at it in-depth, I have realized it seems related to the way I am using Foreign() and TimeFrameSet(). I am sure I am wrong, but I don't find my error, so I would appreciate some help
If I use Foreign() alone, I have no problem and Foreign Data it's ok.
SymbolClose = C;
SPXClose = Foreign("$SPX", "C");
Filter = DayOfWeek() == 5 ;
AddColumn(SymbolClose,"SymbolClose",1.2);
AddColumn(SPXClose,"SPXClose",1.2);
$SPX data (my Foreign Symbol) it's right.
My problem begins when I add TimeFrameSet() function. I see that Foreign data changes for the same dates.
TimeFrameSet(inWeekly);
SymbolClose = C;
SPXClose = Foreign("$SPX", "C");
TimeFrameRestore();
Filter = DayOfWeek() == 5 ;
AddColumn(TimeFrameExpand(SymbolClose,inWeekly,expandFirst),"SymbolClose",1.2);
AddColumn(TimeFrameExpand(SPXClose,inWeekly,expandFirst),"SPXClose",1.2);
But, on the other hand, if I use the same piece of code in Exploration, using $SPX as the current symbol, I see results are ok.
This is what confuses me the most, but I must recognize that surely I have my own big mistake in front of my eyes but I don't see it.
Best regards,