
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
Dear All,
I am newbie in programming. I have been learning about building an ea for two months. This forum is very helpful for my purpose. I am searching the forum and looking for the right code.
Unfortunately programming is very complex sometimes. I have met some problems about my ea.
1. The EA reads an indicator's buy sell arrow then it gives BuyStop/Sell Stop Orders.
The problem is I want it to cancel all previous (buystop/sellstop) pending order after one of them executed/opened. I tried different methods but i failed.
I use the cancel pending orders code from "https://www.mql5.com/en/forum/159380" but when i use the functions in different ways, it cancels the new pending order if there is sell/buy order.
I understand why it is doing because if there is a sell/buy order it cancels all the pending order without looking previous or new. I want it to cancel only previous pending order if there is one them executed.
2. The EA has 3 basket profit feature. They are Total Sell Order Profits, Total Buy Order Profits and Total Order Profits.
The problem is all basket functions close order at the begining of the next bar. It doesn't close when the profits hits the profit target in the process, it waits until closing the bar. I want it to close when orders hit profit target.
I am posting the code here. Please help me to solve.
Kind regards,