Place WindowRedraw() just after creating new objects or changing their properties. Otherwise you need chart to be redrawn automaticaly and that won't happen until a new tick appears.
int init() { CreateAll(); return(0); } void CreateAll() { BuyMarketObjects(); SellMarketObjects(); BuyModifyObjects(); SellModifyObjects(); } // return; ---- Why do you have a return outside your function? void <---- all of them called here int start() {
@ hasayama thank you. I'll add WindowRedraw();
@ enotrek, just a mistake. Thank you for pointing that out.
Also during Init, market bars may not yet be available (except in the tester,) typically when the terminal is starting up the EA gets attached but history from the server hasn't yet refreshed. You need to do it in start. Also Init is called when the EA is attached, chart is changed (pair, time frame, or refresh) Make sure you can handle those cases.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
When I first attach my expert to the chart, it runs int init().
What ever functions I have placed here are to be executed once without a new incoming tick, but I don't think that is happening.
This is where I am getting confused.
My objects are not drawing until int start() is called with 1st tick.