Nurudeen Amedu:
I want to copy trades between 2 platforms, one writes to a csv file in its files folder and i want the other one to read the csv
I tried this but its not working
In the filename parameter, i entered D:\Users\Forbes\AppData\Roaming\MetaQuotes\Terminal\B86ACF179AE0C55FA87E9532FBCA2802\MQL4\Files\TradeCopy
the name of the file is TradeCopy.csv but i either get Error 5004 or Error 5002
please how do i code this?
handle=FileOpen("\\filename.csv",FILE_COMMON|FILE_SHARE_READ|FILE_BIN|FILE_READ);
ok thanks
This file will appear in the following folder:
Application Data\MetaQuotes\Terminal\Common
Application Data\MetaQuotes\Terminal\Common
Nianfu Li:
This file will appear in the following folder:
Application Data\MetaQuotes\Terminal\Common
so i have to read and write with that directory
This file will appear in the following folder:
Application Data\MetaQuotes\Terminal\Common
Nianfu Li:
This file will appear in the following folder:
Application Data\MetaQuotes\Terminal\Common
This file will appear in the following folder:
Application Data\MetaQuotes\Terminal\Common
i was able to write script to delete pending orders if they have been deleted on master account
but i need help with closing open trades closed by master account using magic number
for (j=0;j<RealSize;j++) { // cmt=cmt+nl+"checking "+j+" <> "+x[j]; if (x[j]!=1) { //no master order, close the ticket // Price=MarketPrice(RealOrdSym[j],"close"); // OrderClose(RealOrdId[j],RealOrdLot[j],Price,5,CLR_NONE); if (RealOrdTyp[j]<2) { Price=MarketPrice(j,"close"); result=OrderClose(RealOrdId[j],RealOrdLot[j],Price,5,CLR_NONE); if (result<1) Print ("Close ",RealOrdId[j]," / ",RealOrdLot[j]," / ",Price," failed: ",GetLastError()); if (Balance<AccountBalance()) Balance=AccountBalance(); }else{ OrderDelete(RealOrdId[j],CLR_NONE); } } }
Nianfu Li:
how do i write to the directory?
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
I want to copy trades between 2 platforms, one writes to a csv file in its files folder and i want the other one to read the csv
I tried this but its not working
In the filename parameter, i entered D:\Users\Forbes\AppData\Roaming\MetaQuotes\Terminal\B86ACF179AE0C55FA87E9532FBCA2802\MQL4\Files\TradeCopy
the name of the file is TradeCopy.csv but i either get Error 5004 or Error 5002
please how do i code this?