Composite from symbol allocations

I'm attempted to create a composite symbol comprised of a percentage allocation between symbols in a watchlist. I would appreciate it if anyone could confirm that my code below is doing what I expect which is create a composite that will track a 75/25 portfolio allocation. Thank you for your help.

// run  SCAN to create ticker

combinedClose= Foreign("symbol1", "C" )*0.75 + Foreign("symbol2", "C" )*0.25;
combinedOpen= Foreign("symbol1", "O" )*0.75 + Foreign("symbol2", "O" )*0.25;
combinedHigh= Foreign("symbol1", "H" )*0.75 + Foreign("symbol2", "H" )*0.25;
combinedLow= Foreign("symbol1"," L" )*0.75 + Foreign("symbol2", "L" )*0.25;
AddToComposite(combinedClose, "~MyIndex", "C" ); 
AddToComposite(combinedOpen, "~MyIndex", "O" ); 
AddToComposite(combinedHigh, "~MyIndex", "H" ); 
AddToComposite(combinedLow, "~MyIndex", "L" ); 

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.