MQL4 - automated forex trading   /  

Forum

Passing Vars to Scripts

Back to topics list To post a new topic, please log in or register

avatar
18
stockwet 2006.07.26 17:52 
I'm playing around with scripts and realize that they don't have the ability to set external variables. Is there a way to pass a variable into a script either manually or via another indicator on the chart?

Here's what I'd like to do. I want to identify an upper and lower channel on the chart. I'd like to manually execute the script so that it looks at the price values of the two channel lines, runs a calculation, and places a buy and sell stop order. I have the trading functions working, but, I'm not sure how to grab user defined variables for the script to use. Any ideas?

stockwet
File Operations via WinAPI

File Operations via WinAPI

Environment MQL4 is based on the conception of safe "sandbox": reading and saving files using the language are allowed in some predefined folders only. This protects the user of MetaTrader 4 from the potential danger of damaging important data on the HDD. However, it is sometimes necessary to leave that safe area. This article is devoted to the problem of how to do it easily and correctly.


avatar
Moderator
5198
stringo 2006.07.26 18:42 

#property show_inputs


avatar
18
stockwet 2006.07.26 19:11 
Cool. Thanks.

stringo wrote:

#property show_inputs



avatar
18
stockwet 2006.07.26 19:15 
stringo wrote:

#property show_inputs

I have a related, but different question. Is there a way I can dynamically pre-populate an extern var? For instance, I'd like to have an extern var initially set to Price + 15 pips, then I can manually change it. Is this possible? I've tried declaring a var in the init block, but, I get "initialization expected" when I compile.

avatar
Moderator
5198
stringo 2006.07.26 19:39 

No. this is impossible.

Initialization starts after input variables are set via property sheet

Back to topics list  

To add comments, please log in or register