Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
What are the Ask, Bid, Bars, Close, Open, High, Low, Time and Volume?
Variables?
It was not mentioned in your lessons. May you describe about that?
What is the difference between Ask - Bid and other above mentioned variables?
Current bar is Bars = 0. Right?
And previous bar is Bars = 1.
And what is Bars = -1. Is it 10 or Is it the future bar?
Ask, Bid, Bars, Close, Open, High, Low, Time and Volume are functions not variables!
Quote:
Originally Posted by newdigital
I have a question.
What are the Ask, Bid, Bars, Close, Open, High, Low, Time and Volume?
Variables?
It was not mentioned in your lessons. May you describe about that?
What is the difference between Ask - Bid and other above mentioned variables?
Current bar is Bars = 0. Right?
And previous bar is Bars = 1.
And what is Bars = -1. Is it 10 or Is it the future bar?
Ask, Bid, Bars, Close, Open, High, Low, Time and Volume are functions Although MQL4 called them predefined variables.
Variable means a space in memory and data type you specify.
Function means do something and return some value, For example Bars collects and returns the number of the bars in chart. So, is it a variable?
Another example will proof for you that they are not variables:
If you type and compile this line of code:
Bars=1;
You will get this error:
'Bars' - unexpected token
That’s because they are not variables hence you can’t assign a value to them.
Please leave their description to lesson 11 (Today )
What are the GlobalVariableCheck, GlobalVariableSet, GlobalVariableGet, GlobalVariableDel and GlobalVariableDeleteAll.
In which cases we are using that?
GlobalVariables are a special kind of variables which accessed in the MetaTrader client terminal level, so they are different form the global variables which you declare them in your code at the functions level (review the Scope section in Variables lesson).
I'll give you example of using GlobalVariables , Assume you have 2 EAs running in your client terminal and both of them want to Send Order (OrderSend() function), if they called the OrderSend() at the same time MetaTrader will raise an error, to solve this situation , you may write in your EAs a code like that:
while (GlobalVariableCheck("InTrade")) {
Sleep(1000);
}
Here the OrderSend() function will work only if the GlobalVariable InTrade has been set.
Note: You have to write this code in the both of the 2 EAs which are trading at the same time.
This is something called semaphore and it's an example of using GlobalVariables.
Some people using g for global variables only like
this:
int g_Lots;
void Function1 (int param1)
Is it still usable?
Yes, this is a good programming practice, and it called Hungarian notation.
Hungarian notation is a naming convention in programming, in which the name of a variable (or function) indicates its type or intended use.
You prefixed every variable name with the first letter of the variable type, and that's what Hungarian notation mean.
I'd like to thank you for your efforts with the programming manual. I've worked on my own EA with the help of another and am taking an online class for programming and reading (when time permits). I've been able to see more of the overall pricture with your manual and get a better understanding of the EA programming method. This is really helping me to rewrite what I want to do next in my EA and has given me a better overall view of the programming method.
Thanks
cs
I'd like to thank you for your efforts with the programming manual. I've worked on my own EA with the help of another and am taking an online class for programming and reading (when time permits). I've been able to see more of the overall pricture with your manual and get a better understanding of the EA programming method. This is really helping me to rewrite what I want to do next in my EA and has given me a better overall view of the programming method.
Thanks
cs
cs,
You're welcome!
I'm so happy to see my lessons help you (and the others).
I hope you find the the coming ones as good as the previous.
And the ebook that gathering all the lessons is on the road to you all.
hi codersguru,
one problem ( for me, not for you I hope)
How can I integrate an indicator which gives out a global variable
name of the global varaiable : "trend".
If Value = +1 should be possible a buy action
If Value = -1 should be possible a sell action
If value = 0 nothing should appear
How have I to define the global variable? ( like an indicator??)
And what have I to write in the long entry signal condition???