Hi, I have a dilemma
Learn to code:
https://www.mql5.com/en/articles/496
https://www.mql5.com/en/articles/100
https://www.mql5.com/en/articles/599
and for debugging: https://www.metatrader5.com/en/metaeditor/help/development/debug
https://www.mql5.com/en/search#!keyword=cookbook
Bear in mind there's virtually nothing that hasn't already been programmed for MT4/MT5 and is ready for you!
=> Search in the articles: https://www.mql5.com/en/articles
=> Search in the codebase: https://www.mql5.com/en/code
=> Search in general: https://www.mql5.com/en/search or via Google with: "site:mql5.com .." (forgives misspelling)
- www.mql5.com
Please attach source code files properly, with there original ".mq?" extension.
Don't attach text files with source code in them, and especially not with normal text embedded in it as well.
For small snippets of code, please use the CODE button (Alt-S) when inserting code.
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
First the main trade, then the second trade that takes care of the crumbs.