Understanding Chart (work) Flow
-
Hello,
I am trying to understand the basic Chart (work) Flow.
Assume:
LH/RH Branch do not appear in same EA (they are side by side for comparison only).
On Tick
Only Conditions D & E are met.- Does the Left Hand Branch reach cell 1001, jump to cell 1002, 1004, 1005, 1006 & 3000, before the next Tick?
- Does the Right Hand Branch reach cell 2001 & jump to cell 3000, before the next Tick?
- Does the Right Hand Branch reach cell 2001, jump to cell 2002, 2004, 2005, 2006 & 3000, before the next Tick?
Regards
Paul......
Chart flow.jpg -
In the output MQL4/MQL5 code all blocks are functions, all connections are function calls. At the end of each function there are function calls to the next functions (blocks) connected after the current one. What happens when you run a function which at it's end runs another function
Chain reaction. It goes this way until there is no function to call.- Yes, but it depends which condition is true or false. The thing is, you always reach the possible end of the branch. Well, if there is something slow to do (buying or selling, delays), maybe few ticks will be skipped. But normally conditions are checked really really fast.
- Because 3000 is alone, the block will not even be included in the final project. This is a rule I started with. These alone blocks are "for later use"
- Yes. Whatever is possible to run, it runs within the same tick. Again, 3000 will never run, because it's not used.
Some people think that if a block can't pass, the EA will sit there and wait while it passes. But it does not work this way.
-
I am a bit confused by the answer.
What causes blocks 1000 and 2000 to both be included in the build, but 3000 excluded? Is it the location (close to the top)?
Thanks
-
It's not the location, it's my decision. When the EA is generated it first excludes all blocks that are left alone. Again, because my initial idea was to be able to keep some blocks around like this for "later use".
Now I don't like this concept very much, because when I left few blocks like this, I just forget what was their idea. So I am thinking to make those blocks to run and keep blocks for "later use" somewhere else, in some isolated field... if anyone needs that at all.
Also, I am thinking to remove block numbers. Now what matters (when connected in parallel) is the number of the block - the one with lower number will run first. But what if the block on left (or top) runs first? This is something that I didn't tried yet, but I will eventually do.
-
Thanks very much.
I forgot to connect a Pass Block to Block 3000 in the diagram. I created a small EA to test both Branches separately to confirm that both branches work the same way. I have created EAs using both styles and I started to question if I was doing it correctly.
Hopefully this will help others understand.
Thoughts on Numbering System
-
The main problem I have with the Numbering system is I am constantly manually correcting the number sequence. If I insert or delete a Block from an existing 'chain' it would be great if the numbers would update automatically. If I attempted to create a new separate Block with an existing number, perhaps a "are you sure" before the numbers were automatically updated would be a good idea.
-
A potential problem with 'inferred work flow' within a 'chain' is that it might force you to have messy looking diagrams as you are restricted in where you can position the Blocks.
-
The numbers do provide a great help in understanding workflow. Removing them may make it harder to understand, especially if more than one person is working on the EA.
I am very pleased with the product and certainly would not want to consider coding EAs directly at this stage.
-
-
__
I must admit I originally thought that once entering a 'chain', the EA would stop if it failed a Condition, then jump to the next 'chain' according the Number. This felt logical, but I soon realised it did not work this way.
[/quote:78ewjnqs]
But it works that way. Numbers normally does not matter. Only when you have parallel connections, when you have 2 or more paths ahead, only then the first path to be taken it the one with lower number. -
I must admit I originally thought that once entering a 'chain', the EA would stop if it failed a Condition, then jump to the next 'chain' according the Number. This felt logical, but I soon realised it did not work this way.
[/quote:3cfik6bu]
But it works that way. Numbers normally does not matter. Only when you have parallel connections, when you have 2 or more paths ahead, only then the first path to be taken it the one with lower number.[/quote:3cfik6bu]Sorry, I don't think I described what I meant very well. I have edited the post and taken that line out. Can you delete this post an your last one I have quoted please.