Strategy not producing trades/Alerts in Strategy Monitor
Author: abate
Creation Date: 3/1/2012 6:57 AM
profile picture

abate

#1
I can't get alerts or trades when running realtime from SM when the script is run with industry indicators. When I open the same strategy using the strategy window, I get the alerts and trades. I tried data ranges upto 500 bars but no luck. Any suggestion on what I need to do.
CODE:
Please log in to see this code.
profile picture

Cone

#2
1. Are you using 6.3.14?

2. I don't have your indicators, but presumably the error occurs due to the inability to get a handle on the External Data. Try passing the name of the DataSet that contains your indices. i.e. -

CODE:
Please log in to see this code.


After making a change, save the script, close and re-open the S. Monitor.
profile picture

abate

#3
Cone,

Yes I am using 6.3.14.

I have the handle you suggested in the code- the 5th line after 'try'.
profile picture

Eugene

#4
QUOTE:
I have the handle you suggested in the code- the 5th line after 'try'.

What Cone suggests is to replace your handle with the version with a slightly different syntax and re-try.
profile picture

abate

#5
Eugene,

I changed the syntax to include quotes.
CODE:
Please log in to see this code.


However I am still not getting alerts/trades in realtime.
Can you please help.
profile picture

Cone

#6
I don't know if this is the problem, but it seems clear from the "non results" that your script has a runtime error in the S. Monitor.

What is the name of the DataSet that contains the external industry symbols? Copy it from the Data Manager, please. ""+basicindustry2+"" isn't going to work
profile picture

Eugene

#7
Not quotes. Do you see the DataSetName overload in bold in Cone's reply above?
profile picture

abate

#8
Cone,

The DataSet that contains the external industry symbols is "Index-Lab 30-Minute" which is created by the Index Manager.

The industry symbol that Index Manager creates for "Basic Average" of an industry adds a prefix of "%" to each symbol and uses underscore
instead of space, so I need to convert the standard GICS symbol to that compatible to Index Manager. That's why I am using
"basicindustry2".

I copied and pasted the DataSet per your suggestion:
DataSeries indClose=GetExternalSymbol( "Index-Lab 30-Minute",basicindustry2,true ).Close;
It still doesn't work in SM.

I don't know anyother way to get the closing price of an industry for a stock symbol.
profile picture

abate

#9
Is there a way to debug WL in SM mode so I can find out where a the script is running into errors in SM.
profile picture

Eugene

#10
Sure, it's described in the User Guide:

Strategy Monitor > Strategy Pane > Strategies Right-Click Menu
profile picture

Cone

#11
I think we're dealing with a runtime error in the script here, so since PrintDebug isn't going to help us in the S. Monitor, let's just change your catch block to something like this:

CODE:
Please log in to see this code.
Then you can see the result in the text file created in the UserAppDataPath, which assuming Windows 7/Vista will be: C:\Users\Your Username\AppData\Roaming\Fidelity Investments\WealthLabPro\1.0.0.0

profile picture

abate

#12
Cone,

Below is the error logged. I copied and pasted an external industry that the Index Manager created for the external symbol.
DataSeries indClose=GetExternalSymbol("Index-Lab 30-Minute", "%ADFBI", true ).Close;

2012-03-08 21:56:18,719 [19] ERROR dk [(null)] - Failed to fire OnWatchListGet event: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at WealthLab.DataProviders.FidelityWatchlist.b(bx A_0)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at ao.c()
profile picture

Cone

#13
Please describe the properties of the indices that the script needs to reference. What's the index definition? Are the data in the same intraday scale used to trade the script?
profile picture

abate

#14
I utilized 'Basic Index' in the Index Builder of the Index Manager which averages the values of the symbols provided. In the script I provided I asked the Index Manager to average the values of symbols in the Aerospace industry. I followed the same example provided in the "Using Indexes" in Wealth Lab Users Guide to build my script. The data that the Index Manager builds is is in 30 min intraday. My script uses a 60 min intraday.
profile picture

Eugene

#15
Have you tried matching the bar scales of the Index Manager's and the primary DataSets?
Will the error appear if both DataSets use Daily data?
profile picture

Cone

#16
I'll try to duplicate this today with that setup.

@Eugene: The static Fidelity Provider in WL Pro only allows you to create 30 min DataSets (max intraday base scale) from which 60 min bars must be scaled.
profile picture

abate

#17
Cone,

Thanks

I hope there is a work around to this problem.
profile picture

abate

#18
Eugene,

I run the script in 30 minute scale to match the Index Manager scale but no luck.
profile picture

abate

#19
Cone,

Did you have a chance to duplicate the problem.
profile picture

Cone

#20
I did, but in my case the error was "Index was out of range.".. and now I'm sidetracked. Please create a support ticket for this one. tia.
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).