Is there a way of combining the pricing of, say, the value of 2 stock symbols? Such as VTI and JJC.
I tried this script, and it didn't work. Said I needed to debug it.
If this doable, I would then add other info to the script. In essence, I would like to use the combined value in MA and other indicator calculations. But first...is it doable? If so, how would I rewrite the script above to get the combined value of VTI and JJC?
Yup, that does it. Thanks! But could you tell me the significance of IND in your script? I have looked it up in Help, and am not quite sure. Could you put it (IND) in a simple English statement, that even my mother would understand?
Here is my attempted script (using four's original idea, and trying to add an EMA(20) to the mix. My addition can't be correct, based on the results.
This line must be wrong:
My objective is to print (and draw) the combined EMA(20) of VTI+JJC.
Any help here? The acid test is the result of the combined EMA(20) of VTI + JJC. My resulting number can't be correct (it is way too low), considering the EMA(20) of VTI and JJC (as shown in the column output).
Why am I attempting this? Because I have read that the action of copper (JJC as my proxy) is a precursor for the broad market. Rather than accepting that statement completely, I would like to merge JJC and VTI to get a combined result. Thus, I'm not relying soley on JJC or VTI, but combining the two and measuring that combined price against its combined EMA(20).
Any help on fixing my one line of script (as shown above) would be appreciated. Thanks.
Based on your suggested revised script, here are my most recent findings to test my "logic" of using JJC as part of the barometer of the overall market. That is, VTI+JJC. That combined field got you an EMA(20) crossover on 4/29/11 (sell). Since that date VTI is -16.03%. What a time to be in cash (or short).
Using strictly a VTI EMA(20) crossover, it would have generated a 'sell' on 5/5/11, after which there has been a 14.09% drop in VTI.
I realize that just one testing period does not constitute ample testing. But it's a start. I'll do more testing and post my results here.
By the way, after looking at your output, I think I should have averaged (instead of added) VTI and JJC values. The crossovers should be identical. An average value just looks more realistic. Do you agree or disagree?
Using the SF script initially thought by me (but edited correctly by 'four'), one would use the combined price of VTI and JJC and compare that to the combined EMA(20) of those two symbols. If the combined price > combined EMA(20) that would signal a buy (for the broad mkt.). Less, a sell. Right now (1:10 pm, 9-29-11), that would not favor a long position (price is 93.4% of EMA).
Maybe, or maybe not, the EMA(20) is the best parameter. I haven't tried any other number.
There are addt'l changes to my script for this message, basically to show the "bottom line" result of dividing the duo price of VTI + JJC by the duo EMA(20) of VTI + JJC. Shows it in % form.
For example, close of day, 9-29-2011shows a Duo price of $101.72 / Duo EMA(20) of $107.80, which = 93.71%. Anything less than 100% would indicate NOT to be long in VTI (or other broad-based, equity-type ETF if you used this Duo indicator as a barometer for an overall buy-sell signal.
I'm still not showing one thing, though, in the Chart view, that I would like to display: the Price/EMA crossover lines --- not only for the Duo result, but also the original VTI and JJC price/EMA crossovers. I must have faulty draw commands. ??
*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.