Forum

Checking for existence of a primary id in SQLite database table

I would appreciate if anyone with experience using SQLite in mql5 can show me how to check for existence of a primary id in a given table. For example is my table has long values as primary ids, does that mean I can use DatabaseColumnLong() to retrieve the value in a given column and store it in a

Expert advisor state

Can an expert advisor lose state over the weekend when market is closed since there are no ticks coming in? For example, when I have a boolean flag to Keep track of something that was set to true on Friday and we go into the weekend with the variable still holding value "true" , when market opens on

how to set starting point for plotting

int OnInit () { datetime prev_day = TimeCurrent () - PeriodSeconds ( PERIOD_D1 ); int prev_day_index = iBarShift ( _Symbol , PERIOD_D1 , prev_day, false ); //--- indicator buffers mapping SetIndexBuffer ( 0 ,high_buffer, INDICATOR_DATA ); SetIndexBuffer ( 1

How to check if a trade has been closed and get all details about that trade

Since checking if a position has just closed is flawed due to sometimes async trade processing which means all details of the trade may not be available immediately in trade history. As highlighted in this forum post https://www.mql5.com/en/forum/265060 How do I check if there is a new deal "out

MT5 and External databases

I would like to create an EA that can enable export all my trades (closed and open) to an online database. How best can i go about this. Any links to useful resources are appreciated

Using custom indicator for signals

Hey guys alittle help here , how can I make my EA read a return value from a getSignal() function in a custom indicator ?(like if getSignal function of custom indicator returns 1 when there is a signal) How can I make my EA read that to know that there is a signal created and it can execute a trade

still a newbie please need Coding Help.

I am trying to come up with an indicator that draws a rectangle on chart whenever a fair value gap is detected . its based on the ICT trading concepts for those who are familiar with it. I want to draw a rectangle in between the 3 bars if the high of a candle at index 1 is longer than the low of

RSI array out of range error

Hi guys. newbie here ..I need some help. I would like to use rsi value of 5th candle as part of my entry so I need to keep checking for it's value . I compiled my code and have no errors or warnings. However when using strategy tester, I keep getting array out of range (89,38) . How can I fix this

How to get Ratio of 2 Moving averages

How do I code and get the ratio of 2 moving averages ? Anyone kindly shed some light please. I need to calculate the ratio of 2 Moving averages