Forum

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

Change a global variable in an indicator by an expert

The function Oncalculate() can not be used in an expert. So we have to create our indicator separately from our expert and run both the expert and the indicator on the chart. I have a global variable in my indicator(that I wrote it in metaeditor) and I want to change the amount of this variable when

Hide an object when the scale of a chart changes

I want to hide an object on a chart in Mt5 when the scale of this chart changes to 0 or 1 (the scale can change from 0 to 5). unfortunately MQL5 does not have a command like ObjectSetInteger ( 0 , "name" , OBJPROP_TIMEFRAMES , OBJ_PERIOD_H1 | OBJ_PERIOD_D1 ) for chart_scale. I found a way to hide