Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor - 4164640975: can't open "C:\Users\chomp\AppData\Roaming\MetaQuotes\Terminal\2C68BEE3A904BDCEE3EEF5A5A77EC162\MQL4\Include\order_exit.mqh" include file closeall_loss.mq4You know what the error is. Open the «DataFolder»/MQL4/Include folder and verify “order_exit.mqh” actually exists.
How to make csv file..... - Expert Advisors and Automated Trading - MQL5 programming forum #9 (2022)
FileOpen, FileWrite not working in onTester() - Strategy Tester - MQL5 programming forum (2020)
//+------------------------------------------------------------------+ //| CloseAll.mq4 | //| ThinkTrustTrade | //| www.think-trust-trade.com | //+------------------------------------------------------------------+ #property copyright "ThinkTrustTrade" #property link "www.think-trust-trade.com" extern string Visit="www.think-trust-trade.com"; extern string Like="www.facebook.com/ThinkTrustTrade"; //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { //---- int ticket; if (OrdersTotal()==0) return(0); for (int i=OrdersTotal()-1; i>=0; i--) {//pozicio kivalasztasa if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)==true)//ha kivalasztas ok { //Print ("order ticket: ", OrderTicket(), "order magic: ", OrderMagicNumber()); if (OrderType()==0) {//ha long ticket=OrderClose(OrderTicket(),OrderLots(), MarketInfo(OrderSymbol(),MODE_BID), 3,Red); if (ticket==-1) Print ("Error: ", GetLastError()); if (ticket>0) Print ("Position ", OrderTicket() ," closed. Thank you for using our script! Visit www.think-trust-trade.com for more free tools."); } if (OrderType()==1) {//ha short ticket=OrderClose(OrderTicket(),OrderLots(), MarketInfo(OrderSymbol(),MODE_ASK), 3,Red); if (ticket==-1) Print ("Error: ", GetLastError()); if (ticket>0) Print ("Position ", OrderTicket() ," closed. Thank you for using our script! Visit www.think-trust-trade.com for more free tools."); } } }//pozicio kivalszatas vege //---- return(0); } //+------------------------------------------------------------------+
errors:
can't open "C:\Users\chomp\AppData\Roaming\MetaQuotes\Terminal\2C68BEE3A904BDCEE3EEF5A5A77EC162\MQL4\Include\order_exit.mqh" include file closeall_loss.mq4
'ALL_MARKET' - undeclared identifier closeall_loss.mq4
'exitOrder' - function not defined closeall_loss.mq4

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
hey guys, can you pls help me fix this code. It gives me 3 errors and I have no clue how to fix it. This is not my code and I'm not a programmer. This is to close all loss orders at specific level. Greartl appreciated.
<Deleted>