Ticaret robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Twitter üzerinde bulun!
Fan sayfamıza katılın
Komut dosyasını ilginç mi buldunuz?
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
Komut dosyasını beğendiniz mi? MetaTrader 5 terminalinde deneyin
Kütüphaneler

Database Wrapper - MetaTrader 5 için kütüphane

MoT
Yayınlayan:
mot
Görüntülemeler:
3758
Derecelendirme:
(14)
Yayınlandı:
2021.01.30 09:28
Güncellendi:
2022.09.09 09:24
\MQL5\Include\
Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git

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