help! include, library, and script! - page 3

 

what's the meaning of "you cannot call an Expert Advisor, a script, or an indicator for execution programmatically"? Does it means we can't code a program to run them automatically, I must add them to a chart for running?

 

book states that include file is "a source text of frequently used blocks of custom programs", and "a user can create libraries of custom functions intended for storing frequently used blocks of user programs". my english is not good enough to understand the difference between them, would you please explain more in detail? in fact, are they similar or even the same?

 

Hi tob2011,

tob2011 2012.07.17 05:28

Hi,

I'm now re-reading the book in MQL4. Would you please tell me:

If I put user defined function in library, when a new tick comes, how the priority is decided if several EAs request to execute it?

Thanks for your help.

tob2011

1. There's no reference for this, but I think MetaTrader will create a copy of that library in RAM, so that all EA (and CI and script) will have same priority.


tob2011 2012.07.17 05:51

also,

Book explains that both EA and script are allowed to execute Trade action. On the other hand, if EA is able to execute Trade action, why and when will we use script to do it? just because script only do it once? Also, script will not wait for another tick to come in, if it is used to open order, which quote will it use? last quote or next quote?

If I have some codes to analysis the market, what's the best place I should put it in? indicator, EA or script?

2. Already answered, please don't ask the same question over and over, and re-read your previous question and my answer to it before asking more questions.

You can analyze the market using all of them, though indicator is preferred because it's running in MetaTrader main thread and gets highest execution priority.

Here's the script's answer

5. if I put open order command in EA, it will be executed tick by tick if needed. If I put it in script, it will be executed immediately if needed, right? Correct By my understanding, quote from broker comes when a new tick comes. Is that means, if I use second method, script will use next quote from broker to open new order Wrong, it will use last quote not new one. New quote come with new tick, script does NOT waiting for new tick, no new tick = no new quote. Script use last quote., if I use first method, EA will use next next quote from broker to open order? Therefore, I should use script instead of EA to execute an open order action? Use script for manual trading, use EA for automatic trading.


tob2011 2012.07.17 05:54

what's the meaning of "you cannot call an Expert Advisor, a script, or an indicator for execution programmatically"? Does it means we can't code a program to run them automatically, I must add them to a chart for running?

3. It means, we must add them to the chart manually. However from EA, Script and Indicator we can get value of indicator using iCustom or Technical Analysis function (click that). Only it's value.


tob2011 2012.07.17 06:07

book states that include file is "a source text of frequently used blocks of custom programs", and "a user can create libraries of custom functions intended for storing frequently used blocks of user programs". my english is not good enough to understand the difference between them, would you please explain more in detail? in fact, are they similar or even the same?

4 A. In other words, "a source code in form of readable text of frequently used blocks of custom programs that is frequently used",

4 B. In other words, "a user can create libraries a lots of/collections of/many custom functions intended with intention for storing frequently used blocks of user programs that is frequently used".

I don't speak English either, my English "teacher" was Michael Jackson, Bon Jovi, Madonna, The Police, Rush, etc and I used dictionary to sung their song - lol. Nowadays, use Google translate (http://translate.google.com)

:D

 

" Already answered, please don't ask the same question over and over, and re-read your previous question and my answer to it before asking more questions."

First of all, thanks for your reply.

Also, please accept my apology that I really forget I've asked that question, it's my fault. On the other hand, from your last explanation, I still don't understand that, no matter I trade manually or by auto robot, what's the usage for EA to use "last quote" to execute the command of open order? When EA uses last quote to send the request to broker, the quote is outdated. If I choose the option of market order, last quote is useless. If I use limit order, I will set the price myself. That's why I still don't know about the issue of "last and next quote", whatever from EA, indicator, or script.

Again, I'm really sorry about this thing and please accept my apology.

regards,

wing

 
tob2011:

" Already answered, please don't ask the same question over and over, and re-read your previous question and my answer to it before asking more questions."

First of all, thanks for your reply.

Also, please accept my apology that I really forget I've asked that question, it's my fault. On the other hand, from your last explanation, I still don't understand that, no matter I trade manually or by auto robot, what's the usage for EA to use "last quote" to execute the command of open order? When EA uses last quote to send the request to broker, the quote is outdated. If I choose the option of market order, last quote is useless. If I use limit order, I will set the price myself. That's why I still don't know about the issue of "last and next quote", whatever from EA, indicator, or script.

Again, I'm really sorry about this thing and please accept my apology.

regards,

wing

Hi tob2011,

What you should think about is when your order reach the broker server.

In instant order, if there's new quote and this new quote deviate/far different from your request open price plus/minus slippage, then you get re-quote. if there's no new quote, your order gets opened.

In market order, whether there's new quote or not your order gets opened and you will never get any re-quotes. For example, if there's new quote, your order gets opened with this new quote. If there's no new quote your order get opened with the last quote.

:D

Reason: