|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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? |
|
||||
|
Quote:
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 ) |
|
||||
|
Quote:
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); } GlobalVariableSet("InTrade", 1); // set lock indicator res= OrderSend(....); GlobalVariableDel("InTrade"); // clear lock indicator 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. |
|
||||
|
Quote:
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. |
|
|||
|
codersguru,
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 |
|
||||
|
Quote:
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??? |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lesson 3 - MQL4 Data types | codersguru | Lessons | 20 | 05-18-2007 03:55 AM |
| mql4 tutorial - Where is Lesson 1, etc.? | ftsdPadawan | Metatrader 4 mql 4 - Development course | 2 | 01-15-2007 08:36 PM |
| Lesson 4 - MQL4 Operations & Expressions | codersguru | Lessons | 28 | 12-20-2006 07:25 AM |
| How to enter external variables? | icepeak | Metatrader 4 | 6 | 12-05-2006 04:25 PM |
| MT 3 user defined variables! | TallP | Metatrader 3 | 0 | 07-12-2006 07:09 PM |