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

Database Wrapper - MetaTrader 5용 라이브러리

MoT
게시자:
mot
조회수:
3697
평가:
(14)
게시됨:
2021.01.30 09:28
업데이트됨:
2022.09.09 09:24
\MQL5\Include\
Database.mqh (131.18 KB) 조회
test.mq5 (4.08 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Introduction

SQLite locks are coarse-grained file locks. If multiple tables share a database, you need to pay attention to synchronization issues.
a. It is not recommended to define global variables for the classes in this class, otherwise 5605 errors will easily occur
b. After the query, the data should be retrieved and released as soon as possible to prevent other connections from being unable to obtain the reserved lock

c. Try to Execute in the transaction to avoid some 5605 errors



This is an encapsulation library of DatabaseXXX series functions, which realizes the automatic release of resources


//Open

CDatabase db( "test.db" );   //对象生命周期结束时,自动调用DatabaseClose

Print ( "db IsAvaliable=" , db.IsAvaliable());

// have table

 Print ( "table" ,db.HasTable( "tab" ) ? "exist" : "不存在" );

//implement

db.Execute("创建表tab(aa integer, bb double , cc string );");

for ( int i= 1 ;i< 10 ;i++)
{

db.Execute( StringFormat ("插入 (aa, bb, cc) 值(%d, %G, %s);", i, rand ()/ 100 , SQLiteTimeStr( TimeCurrent ())));

}

//read

CDatabaseRequest req = db.Query( "select * from tab" ); //对象生命周期结束时,自动调用DatabaseFinalize

int v;

req.GetInteger( 0 , v);

int v2 = req.GetIntegerOrDefault( "aa" );

 int v;

double d;

string  s;

bool rc = db.QueryFirst< int , double , string >(v, d, s, "select * from tab" );

 int v[];

double d[];

string s[];

bool rc = db.Query< int , double , string >(v, d, s, "select * from tab" );


Sell using amount instead of lots Sell using amount instead of lots

I find the lot calculation tedious so I just use this script and tell it the dollar amount to use. It then does the rest. This works for any currency.

Buy using amount instead of lots Buy using amount instead of lots

I find the lot calculation tedious so I just use this script and tell it the dollar amount to use. It then does the rest. This works for any currency.

Spread data collector Spread data collector

This EA collects information about the spreads and Shows the number of spreads in the specified range based on the ticks that occur each year.

INDICATOR Breakout Strength Meter - MT5 INDICATOR Breakout Strength Meter - MT5

The breakout strength meter is a trading tool that is used to identify which currencies are the strongest to breakout, and which currencies are the weakest to breakout