Forum

Is the swap calculated during backtesting in MetaTrader 5?

Is the swap calculated during backtesting (by ontester section) in MetaTrader5 ? And does it calculate correctly? That is, does it calculate the swap for each day, or does it use a fixed swap rate? If Yes , I don't see it in the report. I tried it in both cases: Every tick and Every tick based on

How can I count the number of rows of a table in a database X ?

How can I count the number of rows of a table in a database X ? I used the following code but it does not work: int x = DatabasePrepare (db, "SELECT COUNT(*) FROM newdb" ); Comment (x);

Insert variables in a table of a sqlite-database

If we want to insert some values in a table COMPANY of a database, it should be written as below: //--- enter data to the table if(!DatabaseExecute(db, "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (1,'Paul',32,'California',25000.00); " )) { Print("DB: ", filename, " insert

information about next candles in tester

Is it possible to get some information about the next candles in " backtest " ? For example can we obtain the ILOW of the candle with index -1 (next to the last candle)

How can we obtain the GMT time of a datetime variable?

When it's not sunday or a holiday that the broker clock is equal to timecurrent() we can obtain the GMT time of a datetime variable t: t - ( timecurrent() - timeGMT() ) But is there a function that give us the value of timecurrent() - timeGMT() when a broker time isn't changing

How can we say to Metatrader5 that we pushed right click ?

When we push left click the following code help us to do something(for example comment something): void OnChartEvent ( const int id, const long & lparam, const double & dparam, const string & sparam) { if (id == CHARTEVENT_CLICK ) { Comment ("something"); } } I want to do something

Should the laptop(or computer) be on while an expert is working?

I want to create a robot (expert in MetaEditor) but I have a question: Does my laptop need to be on when the expert is working? For example if a robot wants to work for 5 hours, should the computer be turn on for 5 hours

How to change the charts by MQL5?

By the following command we can change the current chart to a specific chart. But it does not work or does not work properly when it is holiday (for example in Sunday or Saturday) or when the chart is offline. Is there another way to change charts (except "Ctrl+Tab")? ChartSetInteger (chart id

Is is possible to open a "buy stop-limit" order (or "sell stop-limit" order) by the class CTrade?

We can use CTrade or MqlTradeRequest to open orders. But I can not find the option "buy stop-limit" (and sell stop-limit) in the drop-down combo box of the class CTrade in MetaEditor. So must I learn MqlTradeRequest to order these orders? And can we work with both CTrade and MqlTradeRequest in one

Is it possible to activate crosshair_tool by right-click or some another keys?

In Metatrader5 CROSSHAIR_TOOL is activated by "Ctrl+F". Is there a code that activate CROSSHAIR_TOOL by another key(and not mouse middle button) or activate that for always