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
The best way to learn is try, even though you make mistakes.
You will unlikely find anyone here willing to write the code for you, because most people do not learn from that.
We have had many new coders ask for examples and then they are back with the same problems over and over again.
Hello,
the first thing that you should do is avoid the old functions init, start, deinit.
Click on New (top left of the editor window) and Expert Advisor and a template using the modern functions will load.
Never open a trade in OnInit(), all data may not be loaded yet.
Why are you passing the current Ask price to functions?
OrderType() //There must be an OrderSelect() first
Make a logic plan, if your current code worked, it would be opening orders nearly every tick and you don't want that
Hello,
the first thing that you should do is avoid the old functions init, start, deinit.
Click on New (top left of the editor window) and Expert Advisor and a template using the modern functions will load.
Never open a trade in OnInit(), all data may not be loaded yet.
Why are you passing the current Ask price to functions?
Make a logic plan, if your current code worked, it would be opening orders nearly every tick and you don't want that
***Click on New (top left of the editor window) and Expert Advisor and a template using the modern functions will load.
R : You mean i create a new one and copy paste my coding to new page?
***Never open a trade in OnInit(), all data may not be loaded yet.
R: You mean i always coding on int start() right?
Why are you passing the current Ask price to functions?
R : i will try orderselect first and and use ordetype()
OrderType() //There must be an OrderSelect() first
Make a logic plan, if your current code worked, it would be opening orders nearly every tick and you don't want that
Make a logic plan, if your current code worked, it would be opening orders nearly every tick and you don't want that
***Click on New (top left of the editor window) and Expert Advisor and a template using the modern functions will load.
R : You mean i create a new one and copy paste my coding to new page?
No, your code is not doing what you want. Write out what you want the EA to do, if you can do flow charts even better
You then have the steps that you will need to follow, then code each step 1 at a time
***Never open a trade in OnInit(), all data may not be loaded yet.
R: You mean i always coding on int start() right?
Modern function is OnTick() not start()
Why are you passing the current Ask price to functions?
R : i will try orderselect first and and use ordetype()
This is where you need the logic plan/flowchart. Your existing code, if it was working would open multiple orders and not a good idea. Remember if you have more than 1 open order, your plan has to include how you will deal with all orders.