Passing Arguments to Strategies
Author: jalalfeghhi1
Creation Date: 9/19/2011 3:06 PM
profile picture

jalalfeghhi1

#1
Eugene, Cone
I have written a system that embeds many functions (strategies) for example, after market analysis, real-time market trading, etc. When I open the Strategy Monitor to add my strategy (or when I do Open Strategy from within a chart), I need to be able to specify which function is to be executed. In other words, I need to be able to pass a parameter to the entry point in my system (main strategy). Do you have any recommendations on how best to pass arguments to the main strategy code? I am considering using strategy parameters for this purpose, isn't there a better way? Will that cause problems down the road?

-Best, J
profile picture

jalalfeghhi1

#2
Forgot to mention, when playing around with straps, it appears that I do not have access to parameters from within strategy monitor, is that right?
profile picture

Eugene

#3
1 - Read it from externally written XML config file. Read it from clipboard. Using a TextReader. A pipe. DDE. Wealth-Lab's global memory. Whatever else -- there's no shortage of ways to pass something somewhere.

But since it all is so obvious I guess you might like to illustrate or rephrase the question. Like, what's wrong with saving an integer Strategy parameter or from exactly where and why to pass arguments?

2 - That's not right.
profile picture

jalalfeghhi1

#4
Eugene,
Thanks, I understand what I should do now. When my strategy executes, it needs to bring up a dialog list box with a list of various options, for example "market open", "market close", etc., the user chooses an item from the list box and then the strategy branches to the right function. If you know of a good code sample in the community on implementing a list box from within WLP, please let me know.

-Best, J
profile picture

Eugene

#5
Jalal,

QUOTE:
When my strategy executes, it needs to bring up a dialog list box with a list of various options,

This one's real easy, here's a method from Community.Components:

Input

Plus a couple more untested ideas from the forums:

Threading and MessageBox?
WL5 : Showing a Windows Form from a strategy script
profile picture

jalalfeghhi1

#6
Eugene,
It works beautifully now, thanks :-0
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).