Webinars

Free Registeration for:

Monday session
Wednesday session
Thursday session

ForeXecutor


Free ForeXecutor Demo Account

Exploring a simple script(2)** PDF Print E-mail

OK a few apologies are in order. When the script was posted yesterday, there were a few errors that found their way into the post. So today at the end of this post you will find a link to down load the file. It will be unlocked and fully accessible for changes.

Today I want to talk about the use of Global variables versus Local variables. This script uses 5 global variable to pass along information. The difference in the two variables is how long the information is held by the variable anf what has access to that information.

Local: Declares a local variable in the chart.  These variables remain accessible only within the particular script. These variables can be assigned an initial value. This value is held only as long as the specified condition is true.

Global: Declares a global variable in the chart.  These variables remain accessible from every IntelliScript that are attached to the same Data Series.  These variables can be assigned an initial value. The value can be held as long as you wish.

For today’s discussion, I am going to explain the first two global variables, because the concept behind them is detailed enough to fill this post.

global int ii
global int hh


When we initially wanted to set up the script we needed a way to count the process that we were going through. This counting needed to be done for several reasons, none of which are used in the final iteration of the script but we left in so we could test other changes as well.
The original reason was to add contract names. Remember that you cannot have more than 1 trade open in one direction at a time. That is unless they have different names. Counting was a way to add a different name. After each addbuyentry/addsellentry you will see the following lines of code

hh=hh+1
ii=ii+1


This steps the value up 1 for every time the group is “true” and a new signal is created. We could then add:

Contract = “+ii+” or Contract = “+hh+” behind the addbuyentry or addsellentry and new positions in the same direction would be created with a contract name of a number. Now lest you think it’s all that easy, remember you would also have to exit each of those contracts too. For this reason we abandoned this strategy in favor of another but left it there in case we wanted it in the future.

Comments
Add New Search
+/-
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
 
Please input the anti-spam code that you can read in the image.
Kimball  - Correct     |19
I completely agree Ryan. The scripting here is much more valuable to the average
currency trader.
Ryan  - President     |36
You can not get this kind of Intelliscript help in the forex industry. The
trading software is far better than MT4 and the only thing missing is the
support. Thanks for the great valuable script. This allows me to really see
that Forexecutor VS. MT4 is no match!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."