Hi,
I have a question which I hope I can get some help with.
- I have 2 signals running together on one workspace.
- They both use intrabarordergeneration=true
- they both use variables with the same names (most are declared with intrabarpersist).
- The 2 signals are mutually exclusive. i.e have no relationship with each other. One goes LONG on bullish signs and the other goes SHORT on bearish signs. They also share one account.
My questions is - Is there a potential issue with both signals using variables with the same name? i.e Will the first signal accidently use the value of a variable running in the 2nd signal?
Why don't I just separate them into their own individual workspaces? Because my broker (LMAX) has a restriction of how many accounts I can hold and I want to avoid opening another account.
Cheers
Champski
Same named variables used in 2 signals on one workspace [SOLVED]
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Same named variables used in 2 signals on one workspace
Hello Champski,
Let me address my answers in the order:
Let me address my answers in the order:
On 1 workspace, but on different charts or on 1 workspace and on 1 chart?- I have 2 signals running together on one workspace.
The variables are available only within 1 script. Only global variables are available for multiple scripts at the same time.My questions is - Is there a potential issue with both signals using variables with the same name? i.e Will the first signal accidently use the value of a variable running in the 2nd signal?
The number of workspaces is in no connection to number of broker accounts.Why don't I just separate them into their own individual workspaces? Because my broker (LMAX) has a restriction of how many accounts I can hold and I want to avoid opening another account.
Re: Same named variables used in 2 signals on one workspace
Hi Henry,
I understand in MC.NET you don't have the notion of "Global Variables".
How can you exchange data between your charts or between your indicators (each referencing a different stream of data) in MC.NET?
Thx
I understand in MC.NET you don't have the notion of "Global Variables".
How can you exchange data between your charts or between your indicators (each referencing a different stream of data) in MC.NET?
Thx
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Same named variables used in 2 signals on one workspace
Hello Andrei,
Global Variables work the same way both in MC and in MC .NET.
Global Variables work the same way both in MC and in MC .NET.
Re: Same named variables used in 2 signals on one workspace [SOLVED]
For clarification, the term "Global Variables" in MultiCharts refers to a particular method of sharing data between different signals/indicators. To do this, you need to use the Global Variables dll. More information here:
viewtopic.php?f=16&t=10094
Unless you are using Global Variables, all of the variables are local in scope to the particular signal or indicator in which they are declared, and won't be shared with other signals or indicators. E.g., a variable named XYZ in one signal won't conflict with another variable named XYZ in a different signal.
Also, the variables are private in scope, and aren't shared between different "copies" of the same signal or indicator. E.g., if you have two different charts that both use the same signal, they won't use the same variable -- instead, they will each have a private variable that is limited in scope to that particular chart/signal.
viewtopic.php?f=16&t=10094
Unless you are using Global Variables, all of the variables are local in scope to the particular signal or indicator in which they are declared, and won't be shared with other signals or indicators. E.g., a variable named XYZ in one signal won't conflict with another variable named XYZ in a different signal.
Also, the variables are private in scope, and aren't shared between different "copies" of the same signal or indicator. E.g., if you have two different charts that both use the same signal, they won't use the same variable -- instead, they will each have a private variable that is limited in scope to that particular chart/signal.