molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Fri May 10, 2024 10:40 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Trade Gets Executed with Embedded False Return
PostPosted: Tue Jun 05, 2012 9:29 pm 
Offline

Joined: Wed Mar 14, 2012 12:31 am
Posts: 118
Here's the MQL block containing part of the buy side logic. I've highlighted all of the AND operators. I've also highlighted my typo in Red. Molanis not only cleared the code syntax, but it compiled the .ex4 file containing a syntax error involving an MQL operator.

My initial understanding was that the "Test Trading Condition" button located on the MQL code editor interface, was for the purpose of checking and verifying MQL syntax, and that if an error in syntax was present, the MQL code editor would prompt the user. It works that way all the time with missing parenthesis, for example. It also works when you don't use the correct syntax for MQL function names, as another example.

However, it does not seem to work the same way with MQL Operator syntax errors, or Operator typo errors, and I'd confirm whether or not this is true. The code you see below passed all MQL code editor checks and it also compiled, as stated above. But, the most interesting part was not that it actually executed a trade, even with a clear error embedded in the second to last AND operator.

The entire block of code is supposed to return 'true' before the trade is executed, a there are no OR operators in this segment of code. Yet, one of the conditions is flat out in error. Still, this code segment will execute a trade. Can you explain why the trade gets executed, even with one of its required parameters/conditions returning what should have been "false."

iCustom(Symbol(),PERIOD_H1,"iCustom_1",2,0)>iCustom(Symbol(),PERIOD_H1,"iCustom_2,3,0) && iCustom(Symbol(),PERIOD_H1,"iCustom_3,2,1)<=iCustom(Symbol(),PERIOD_H1,"iCustom_5,3,1) && iClose(Symbol(),PERIOD_M1,0)>=((iLow(Symbol(),PERIOD_H1,0)+iCustom(Symbol(),PERIOD_H1,"iCustom_6,3,1))+(iHigh(Symbol(),PERIOD_H1,0))-(iCustom(Symbol(),PERIOD_H1,"iCustom_7,3,1)))/2 && TimeHour(TimeCurrent())>=00 & TimeHour(TimeCurrent())<=23 && TimeMinute(TimeCurrent())<=59

Where condition:

TimeHour(TimeCurrent())>=00 & TimeHour(TimeCurrent())<=23

Should have returned false given the typo in the operator.

Thanks.


Top
 Profile  
 
 Post subject: Re: Trade Gets Executed with Embedded False Return
PostPosted: Tue Jun 05, 2012 9:41 pm 
Offline

Joined: Wed Mar 14, 2012 12:31 am
Posts: 118
Is the trading condition in the pic below truly "OK?" It looks wrong when isolated from the rest of the code and the typo can be easily seen. Yet, the condition is returned as "OK" by the MQL editor?

Even though the trade was executed at 00:00, and well within the coded range of time (00:00 to 23:00), the AND (&&) condition looks like it should have returned false given the typo, therefore not allowing the trade to be executed, since execution should depend on the entire condition returning true.

Image


Trade is then executed (Long/Buy) even with AND condition returning true:

Image


Should this be happening? If so, what am I lacking in my understanding of MQL operators and the need for conditions that should return true before execution?

Thanks.


Top
 Profile  
 
 Post subject: Re: Trade Gets Executed with Embedded False Return
PostPosted: Tue Jun 05, 2012 10:00 pm 
Offline

Joined: Wed Mar 14, 2012 12:31 am
Posts: 118
Of course, as usual - things just got even more interesting.

I added parenthesis, separating both Time() functions, but allowed the operator AND typo to remain. Here's what transpired after using the MQL editor to verify the syntax:

Image


I then kept the parenthesis and corrected the typo and got this:

Image


I then remove the two internal parenthesis, and keep the two external parenthesis, to isolate the entire condition - but I LEAVE the typo in place. Here's what that returned:

Image


I am now more confused than before about how Molanis handles MQL operators and required conditions.

Thanks for the help.
cfx


Top
 Profile  
 
 Post subject: Re: Trade Gets Executed with Embedded False Return
PostPosted: Tue Jun 05, 2012 11:34 pm 
Offline

Joined: Wed Mar 14, 2012 12:31 am
Posts: 118
To narrow the focus, I did one more test. I changed the trade execution window to 01:59. One code snippet contains the correct use of the MQL AND operator, and one does not.

This MQL block successfully executed the trade as expected:
Image

This MQL block failed to execute any trade as expected:
Image

One had incorrect syntax and the other had correct syntax. Yet, both MQL blocks tested "OK."

Ok, that's all the testing I can think to do on this for now. Thanks.


Top
 Profile  
 
 Post subject: Re: Trade Gets Executed with Embedded False Return
PostPosted: Wed Jun 06, 2012 10:20 am 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
Code:
However, it does not seem to work the same way with MQL Operator syntax errors, or Operator typo errors, and I'd confirm whether or not this is true. The code you see below passed all MQL code editor checks and it also compiled, as stated above. But, the most interesting part was not that it actually executed a trade, even with a clear error embedded in the second to last AND operator.

Metatrader checks the commands for syntaxis - meaning it is well written and inputs have the right type (i.e. you don't have a number when you are supposed to have a character). That's what the testing does. It verifies syntaxis, it verifies that compilation is ok. Metatrader does not check that your logic makes sense. It's your job to do that. Users that do not use the mql icon do not have to worry about this because the strategy builder always generates the right code - there is no need to think or learn mql. My concern here is that you are confusing beginners implying that our product does not work. Your code is the one that does not work. If you do a>b>c, it has a correct syntaxis, the logic does not make sense but the mql is fine. That's what you have to learn.

If you use the mql icon you need to know a bit of mql. Again, this forum is not an mql forum. This forum is for product support, teaching mql is beyond free support. Your mql question should be asked in a different forum.


Top
 Profile  
 
 Post subject: Re: Trade Gets Executed with Embedded False Return
PostPosted: Wed Jun 06, 2012 12:00 pm 
Offline

Joined: Wed Mar 14, 2012 12:31 am
Posts: 118
admin wrote:
Metatrader checks the commands for syntaxis - meaning it is well written and inputs have the right type (i.e. you don't have a number when you are supposed to have a character).


Got it. This is what MT4 does. However, what I wanted to know was why the Molanis MQL Editor returns "OK" when the syntax itself is not "OK." That's the question.


admin wrote:
That's what the testing does. It verifies syntaxis, it verifies that compilation is ok.


You did not use the word "Molanis." So, I'm going to assume here, that your reference to "testing" and "compilation" is something that your product (Molanis) is responsible for doing.


admin wrote:
Metatrader does not check that your logic makes sense. It's your job to do that.


Which is the case in any logic driven end-user application, including Excel. Excel, won't define logic for you - but it also won't allow you to create Circular References, as just example. MT4, will allow you to create Circular References when you make a logic error, or mistake in your code.


admin wrote:
[b]Users that do not use the mql icon do not have to worry about this because the strategy builder always generates the right code - there is no need to think or learn mql.


Users that do not use the MQL block, cannot create anything more than the most basic of EAs. There is no way possible, to build any of the EAs that I have created with Molanis thus far, using only the TA+ blocks. It is simply not possible. Therefore, any user of Molanis, who intends to build anything more complex than cross-over strategies while using the TA+ blocks alone, will have to design their own unique iCustom indicators with inherent complex calculations yielding the kind of output (modes) that allows for the design of more complex trade logic.

Otherwise, if you intend to design something sophisticated, you have no choice but to use the MQL block.


admin wrote:
My concern here is that you are confusing beginners implying that our product does not work.


Hopefully, beginners are not wearing blinders and can read for themselves, because I've never implied that your product does not work. To wit, you should actually read some of my very first posts about your product, which praise it for its ability to create basic EA designs in rapid time. Any beginner having read those posts, will draw a different conclusion about what I have actually wrote on this forum.

Moreover, you don't market "Molanis For Beginners." That's not at all what you market, or advertise. You said that I'm confusing beginners, when your own website and product marketing offers, tell beginners outright, that they can create sophisticated EAs using Molanis. Sophisticated EAs, is what I'm trying to produce with Molanis. And, all of my posts to date, have been inline with that goal.


admin wrote:
Your code is the one that does not work. If you do a>b>c, it has a correct syntaxis, the logic does not make sense but the mql is fine. That's what you have to learn.


At the very start of my post, I specifically stated and I even highlighted the original code and the typo containing the error in the operator for AND (&&). So, telling me that my code is the problem, completely missed the point. The question behind the post was not about whether or not the code was correct, or incorrect - I specifically made that clear by pointing out the typo. So, obviously, I would have fixed the typo before making the post.

Therefore, the post had to have been about something else. That something else, happens to be the contradiction in the MQL Editor of Molanis, where I posted pictures of the Editor as it throws a dialog to screen indicating that the syntax was "OK," when it clearly was not "OK." That's what my post was about. However, you've turned it into something else entirely. This post was not about me, or the typo. It was about the question of WHY the Molanis MQL Editor returns an "OK" in syntax that is clearly not "OK."

Here's the dictionary definition of the word Syntax: http://dictionary.reference.com/browse/SYNTAX

Syntax: noun

2. Logic.

- That branch of modern logic that studies the various kinds of signs that occur in a system and the possible arrangements of those signs, complete abstraction being made of the meaning of the signs.

4. Computers .

- The grammatical rules and structural patterns governing the ordered use of appropriate words and symbols for issuing commands, writing code, etc., in a particular software application or programming language.

Those are not my definitions. So, I can't be accused of confusing beginners with a dictionary definition. Again, hopefully, beginners can read for themselves what I've actually written.

I think you have misinterpreted some of my posts and I don't think you take helpful criticism of your product very well. I ran the "End-User Application Ergonomics" team for several SV software companies. I've run such projects for Bloomberg, Reuters, Thompson, etc., just to name a few. All of the projects were financial market software applications of some kind. My sole responsibility was to increase End-User efficiency through better Application Ergonomics. That's what I used to get paid to do. Today, I write my own checks as a full-time trader. My posts probably reflect the years of experience that I have with applications and their respective ergonomic intelligence.

I have given you several product enhancements ideas, all based on End-User ergonomic considerations that prevent Molanis users from being able to build certain kinds of EAs, and/or certain classifications of trade logic. The multiple ideas about the Integrated MQL Editor Functions, and especially the ideas about the MQL Iteration Editor. Having an Iteration Editor, would allow traders to create dynamic trade execution ranges, without knowing how to code in MQL - which is supposed to be what Molanis is all about! Not to mention the five (5) other product enhancements that further improve the traders ease of use, that I have not posted.

The reason I have not posted those enhancement ideas, is because you claim to want End-User input about how to advance Molanis, but when you get that input, you don't seem to appreciative to have received it.


admin wrote:
If you use the mql icon you need to know a bit of mql. Again, this forum is not an mql forum. This forum is for product support, teaching mql is beyond free support. Your mql question should be asked in a different forum.


So, you do need to know MQL in order to build anything beyond a simple cross-over system, or anything more complex than that.

Here's a really important bit advice - you can take this anyway you like. You have decided to enter the business of Visual EA Development for the MetaTrader Trading Platform. That decision comes with some responsibility and it should come with the common sense understanding that you cannot separate MetaTrader Expert Advisors and MetaTrader Indicators, from its native programming language, MQL. That's like trying to separate Hydrogen from Oxygen in an H2O binding. Everyone, already knows and understands that MetaTrader itself, is lousy at providing product support. That's a known fact throughout this business.

When you come to market with a product and you claim that product to bridge the gap between the Complicated and the Uncomplicated, that's a very tough responsibility to uphold, when you start to get to ground zero where the EA has to actually work. Shielding the End-User from complexity is a great goal, but at the end of the day, most traders grow out of the need for simple cross-over systems. When your product claims to allow the trader the ability to create sophisticated EAs, and requires the use of native code, and then you side-step the support merely because the trader posts questions about said native code, then you failing to meet the mandate that you set for the product.

I think you are 100% correct. If you are going to build a complex EA for use in MetaTrader, then knowing something about MQL is mandatory. However, when you market your product as being the solution that bridges the gap between the simple and the complex, and you offer that solution with the stipulation that "No Programming is Necessary," then you need to step-up to the plate and meet the mandate that you place on yourself.

Passing the MQL buck to snake pits like MQL4.om, where every post turns into a contest of "Guru's" who don't know the difference between being a good programmer, and being a good trade logic developer, is probably not the best idea, or the best place to send your customers and/or your potential customers. If there were a genuine place to go to online to learn MQL, that might be a horse of another color. But, viper pits like MQL4.com, are places were MQL coders like to go to show-up what they know, not necessarily help a newcomer to MQL get up to speed. Just some FYI, in case you were not already posting on MQL4.com.

It is very unfortunately that your misreading and misinterpretation of my both my motives and your product, lead to such a diversion in this thread. People have already stated on this forum, that they have learned something from my posts, given the kinds of things that I try to do inside my EAs. So, why you would, or could misinterpret what I actually posted, when anyone can read it for themselves, is only something that you can answer.

All the best with your product and your business model.

Regards,
cfx


Top
 Profile  
 
 Post subject: Re: Trade Gets Executed with Embedded False Return
PostPosted: Wed Jun 06, 2012 12:22 pm 
Offline

Joined: Wed Mar 14, 2012 12:31 am
Posts: 118
admin wrote:
This forum is for product support, teaching mql is beyond free support. Your mql question should be asked in a different forum.


The thread did not ask you to teach me MQL. The thread asked if there was a reason why the Molanis MQL Editor confirmed an "OK," when an error in syntax was present and for future reference, whether or not I should expect that as normal behavior of the product.

The point that's being missed here, is one that typically gets missed by application programmers and developers. That is, how much of the End-Users time will be consumed in figuring out whether or not a problem they encounter is born of their own mistake, or if the normal behavior of the application presents itself in such a way that makes it difficult to determine where the problem exists.

Good Error Reporting back to the End-User, typically solves most of these issues. But, when a procedure is allowed to continue without End-User notification that there might be a problem, then the End-User has a difficult time figuring out the source of the problem. That's is a huge component of good Application Ergonomics.

When you send confirmation of Molanis Technical Support membership via email, you send it with a welcome message that clearly indicates that the forum is the proper place to "ask the experts" about "...expert advisor programming."

Image

I have never posted a thread asking Molanis, to help me build an EA from scratch. I have always posted MQL questions in relationship to the Molanis product and its functionality in preparing EAs, which is precisely what your welcome message indicates that I should have done.

cfx


Top
 Profile  
 
 Post subject: Re: Trade Gets Executed with Embedded False Return
PostPosted: Wed Jun 06, 2012 1:04 pm 
Offline

Joined: Wed Mar 14, 2012 12:31 am
Posts: 118
To make my intentions crystal clear, I had already created a site for the public discussion of certain aspects related to my research involving the possibility of converting my Excel based prototype to an OOP version, by first doing some proof of concept projects using MQL. My prototype trading system runs in Excel and generates one signal per day, as it does not use lower time frame data. It does not use traditional indicators and only utilized indicator designs that created from the ground-up.

MQL and MT4, are being used be me as a test facility, to determine whether or not my indicator designs have viability in the lower time frames. I grew weary of ego driven nonsense seen on most FX boards and decided to create temporary place online for both the R&D of my project and for the serious minded Trader, to get together with like minded individuals, for the purpose of discussing new trading concepts without the typical FX Forum banter and disruption.

That R&D site was going to feature the Molanis Strategy Builder, as the Visual EA Development platform of choice for the CollaborativeFx: http://collaborativefx.forumer.com/index.php

I have not yet begun to roll-out the sites existence, so only a few members exist through private invitation only. However, there will be YouTube Introduction of the research site.

New traders don't have the facility to understand the ultimate importance of learning good trade logic development skills. They know it intuitively, but they have no way of appreciating just how important it will be to their career as a trader, if they stay in the business long enough to make it. The CollaborativeFx, will be all about the fundamental principles of solid trade logic, which comes before coding, platforms, brokers, funding accounts, or anything else associated with trading. Most importantly, new traders need to understand that developing using a programing language, is not the same thing as developing trade logic.

So, when you say that I might be confusing "beginners," and when you push off my posts to "One-Upsmanship" pits like MQL4.com, you really do misunderstand where I was headed with all this.

The CollaborativeFx, is a free site, will always be a free site and will never offer anything for sale - either in public, or in private. Its will be all about Research, Learning and Growing as a Trader. Something sorely missed in the world of online FX these days.

It will also feature a Visual EA Builder, because I am convinced that such application concepts are a great way for new traders to get up to speed on developing good structural thinking early, which will be very important to the development of solid Trade Logic skills.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009