Annother question I would like to use an external symbol where I can use the
moving average of this symbol
CODE:
Please log in to see this code.
Size:
Color:
See the WealthScript Programming Guide > DataSeries > Accessing Secondary Symbols.
The 2nd line is not working because you're passing a Bars object (external) to the indicator (SMA) that accepts a DataSeries as a parameter. Hint: Try "external.Close" instead of "external".
Size:
Color:
I am running a strategy on an option symbol from QuoteMedia. The only symbol in my dataset is "@XLU 121222C00035000". I am able to do operations on the option with no problem. I added to the strategy the capability to check for being above a 200 day moving average of the underlying asset XLU. I used GetExternalSymbol(underlying, true) and I am able to get the latest close price but I can't compute the 200 day SMA. I always get 0 for the SMA value. I believe I used similar techniques to what is found elsewhere on this site.
Here is my code snippet:
CODE:
Please log in to see this code.
Any insight would be appreciated.
Thanks in advance
Rob
Size:
Color:
You must not be loading at least 200 bars. Since you're using a 200-bar indicator, you shouldn't be looking at values before 200 bars...
CODE:
Please log in to see this code.
And make sure that you load a minimum of 200 bars.
Size:
Color:
ok. I just tried that by there is only 100 bars of the option data available so no trades occurred.
That would work if 200 bars of the option history existed.
I have this set to start evaluating my strategy after only 10 bars of the option data exists.
Is there a way to find the 200 SMA of the underlying (XLU) when only 10 bars of the option exists?
Rob
Size:
Color:
QUOTE:
Is there a way to find the 200 SMA of the underlying (XLU) when only 10 bars of the option exists?
Yes: use a crystal ball.
Size:
Color:
I stumbled onto this thread by chance and noticed that a crystal ball is no longer required when you actually have > 200 bars of historical data but are simply limiting the amount of loaded data
on the chart. The picture at the bottom says it all:
Grab Community Components library and use >
GetAllDataForSymbol method.
Size:
Color: