Disliked{quote} Thanks, I tried to put it into mt4 but that didn't work, I also tries to copy the code from your screenshot and use in meta editor for mt4 but I could not get that to work either, can you help again? Thanks again for your help!Ignored
In MetaTrader there are 5 (common) types of files:
.ex4 (this is the program version for expert advisors/bots and indicators in MetaTrader4)
.mq4 (this is the source code for expert advisors/bots and indicators in MetaTrader4)
.ex5 (this is the program version for expert advisors/bots and indicators in MetaTrader5)
.mq5 (this is the source code for expert advisors/bots and indicators in MetaTrader5)
.mqh (this is source code for scripts/include files, which is used to store repeated code)
The file I provided for you is an .ex5 file.
If you're trying to translate the screenshot, understand that the code will not work directly in MQL4 because of the custom functions I added.
Instead of "PlaceTrade", you would use the "OrderSend" function in MQL4 (https://docs.mql4.com/trading/ordersend)
Instead of "CheckIfOpenPositionsByMagicNB", you would use "OrdersTotal() == 0" (https://docs.mql4.com/trading/orderstotal)
The last bracket is the end of the "OnTick()" function (https://docs.mql4.com/basis/function/events)
Let me know if you have any other questions
Software Developer and Music Producer
News Fundamentals All Time Return:
1,159.1%