I've coded my first MQL4 program (Yay!!!), but can't get the start() part to execute.

 
Am testing a very simple program with init and start routines by duplicating the same Alert messages in both. Can get the init to run when I start the program but but for some reason the start does not run. What does it mean when the manual says "when new quotations are received, the start() function of attached expert advisor is executed"....aren't new quotations coming all the time ? Here's my start code...I dont get anything, not even the Alert("Start") at the beginning:

int start()
{
Alert("Start");
int i,volume_wrk, threshhold=1;
double rates[][6];
// set threshhold based on time frame of bars
if (Period() == 1) threshhold = 10;
if (Period() == 5) threshhold = 50;
if (Period() == 15) threshhold = 90;
Alert("Start - Time Frame:",Period());
Alert("Start Minutes Volume: ",volume_wrk," Volume[0]: ",Volume[0]);

return(0);
 
In EAs and Indicators the start() function will be triggered once for every incoming tick. It should be called many times, over and over, but it won't do anything on weekends. The only exception are scripts. In scripts the start function is only called once and when start() in a script returns the script will remove itself.
 
7bit wrote >>
In EAs and Indicators the start() function will be triggered once for every incoming tick. It should be called many times, over and over, but it won't do anything on weekends. The only exception are scripts. In scripts the start function is only called once and when start() in a script returns the script will remove itself.


I ran it last night when the market was already started but still only got the init() to execute.

What are the ticks...are they when the prices change ?


 
 
Look in the Journal tab. See a divide by zero? If the init dies, so does the EA
 


I found out what I'm doing wrong...found this option in the standard toolbar.


"Enable Expert Advisors
This option allows to enable or disable the use of all expert advisors. If it is disabled, the start() function will not run for all expert advisors when a new tick incomes. At that, daggers will appear instead of smileys opposite the names of experts in the upper right corner of the chart. To enable expert advisors, it must be enabled and the "OK" button must be pressed. As soon as a new tick incomes, expert advisors will start working, and daggers in the upper right corner of the chart will become smileys again.


Thanks for your suggestions...I'm learning from your hints.

 
JulioJFL wrote >>


I found out what I'm doing wrong...found this option in the standard toolbar.


"Enable Expert Advisors
This option allows to enable or disable the use of all expert advisors. If it is disabled, the start() function will not run for all expert advisors when a new tick incomes. At that, daggers will appear instead of smileys opposite the names of experts in the upper right corner of the chart. To enable expert advisors, it must be enabled and the "OK" button must be pressed. As soon as a new tick incomes, expert advisors will start working, and daggers in the upper right corner of the chart will become smileys again.


Thanks for your suggestions...I'm learning from your hints.

Can you show how to "Enable Expert Advisors".
I met the same problem.
Thank you very much.

Reason: