2) no need MessageBox() to chack or test something use Print() or Alert() (easier)
Thank you for the quick response
1. Since I didn't do include, Why did the MessageBox() worked on init() and deinit() functions?
2. Where do I see the output of Print()?
Thank you for the quick response
1. Since I didn't do include, Why did the MessageBox() worked on init() and deinit() functions?
i don't know
2. Where do I see the output of Print()?
in the "experts" tab
MessageBox needs to click on a button to purchase the programm and if not clicked, even if there is a tick (wich will automatically execute the start function), the programm (EA) will not be execute untill you have clicked on the init MessageBox () button
I think it's the explication
Maybe I wrongbut it's what I think...
Is it possible that it doesn't work since I'm using a Demo account?
I thought of trying working with a demo account first before I move to a real account...
when I tried to call start() function from the init function it was executed
You don't call start() . . . it is called when a tick arrives . . . if you have no ticks because you are offline start will not be called.
Try running it in the Strategy tester.
Please use this to post code . . . it makes it easier to read.
MessageBox needs to click on a button to purchase the programm and if not clicked, even if there is a tick (wich will automatically execute the start function), the programm (EA) will not be execute untill you have clicked on the init MessageBox () button
I think it's the explication
Maybe I wrongbut it's what I think...
I did click it, and I also removed the MessageBox() on init() function so the only line of code I had was the one in start, didn't work
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello
I'm very new to MQL4 programming but I have a lot of experience in programming
I started with the most simple program to get a first feel of how things work. init() function is being called but start() function is never called
This is my code:
#property copyright "talfink"
#property link "http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
MessageBox("Hello world\n");
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
MessageBox("Goodbye world\n");
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
MessageBox("Running world\n");
//----
return(0);
}
//+------------------------------------------------------------------+
when I tried to call start() function from the init function it was executed
Can anyone explain me why start() function is not executed? or send me a link how to use it?
I tried to look for a solution online but couldn't
And I run my EA while there is trading, I see the quotes changing on the graph but I never get to start() function
Thank you in advance,
Tal