거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

Writing the quotes to a txt file with the full path and file name - MetaTrader 4용 라이브러리

조회수:
4015
평가:
(8)
게시됨:
2016.03.25 13:57
ITTPSymbol.dll (384 KB)
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Function Description:

#import "ITTPSymbol.dll"  
    int CreateFile(string Path, string symbol, int Priсe);

An example of a function call:

 CreateFile(Path, Symbol(), Ask);

As you can see, everything is very simple. The function will create a text file with the name 'symbol' and write(overwrite) the 'Price' value there. According to the path specified in the value of Patch. This library was written in Delphi. If anyone is interested, they can redo it.

The source code of the library in Delphi:

library ITTPSymbol;
 
 uses classes, Dialogs,sysutils;



{$r *.res}
function CreateFile(Path: Pchar ;  Symbol: Pchar;  Priсe: integer ): integer; stdcall;
 
var outfile: TextFile;
 
begin
AssignFile(outfile, string(Path)+'\' + string(Symbol) + '.txt');
 
 try
   Rewrite(outfile);
   writeln(outfile, Priсe);
   CloseFile(outfile);
   Result:=0;
 except
   Result:=1;
 end;
   Result:=0;
 
end;
 
exports CreateFile;
 
end.

if the function ran successfully the CreateFile() function returns 0, otherwise -1.


Sample script that writes a file with the name of the current symbol the script was run on to the C:\ drive. At the same time the 'Price' parameter of 'integer' type is written to the file:

//+------------------------------------------------------------------+
//|                                                   ITTPSymbol.mq4 |
//|                                        Copyright © 2007 ITTP Gr. |
//|                                         http://www.ITTPortal.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007 ITTP Gr."
#property link      "http://www.ITTPortal.net"
//---- 
#import "ITTPSymbol.dll"  
    int CreateFile(string Path, string symbol, int Price);
string Path;
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
      Path = "C:"; // The last slash "\" is not specified! 
   CreateFile(Path, Symbol(), 53); 
//----
   return(0);
  }
//+-------

That is it, use at will.

16.04.2007. Fixed several errors in the new version of the dll:

  • replaced Patch with Path;
  • removed the unnecessary code from the library itself.

The old version of the library is deleted, so that it can be downloaded safely.

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/7084

OsMACD OsMACD

The OsMACD indicator is a combination of the colored Moving Average of Oscillator(OsMA) and Moving Average Convergence/Divergence(MACD) indicators.

TimeLib by BabyBear TimeLib by BabyBear

Additional functions for working with the datetime variables.

CurrencyChart CurrencyChart

The CurrencyChart indicator allows to display the charts of multiple currencies (symbols) in a single window.

Extended Regression StopAndReverse Extended Regression StopAndReverse

Universal trend utility for near predictions and making decisions by "stops" and/or "stops/reversals" of the orders.