Forum

can tester communicate with real file and folder? (for debugging)

I have an EA from others, which copies, reads and writes csv file in MQL5/FILES folder under metatrader. It's too complicated, much over my coding knowledge but still I want to revise it a bit. So I did a simplified experiment and I found that, with tester, I can not copy file to the real MQL5/FILES

OnCalculate function not found in custom indicator?

There's a given Moving Average indicator, it works in MT5. Now I'm trying to add a text object tagging the MA value of last bar. #property indicator_chart_window #property indicator_buffers 1 #property indicator_plots 1 #property indicator_type1 DRAW_LINE #property indicator_color1 clrWhite

in indicator, line draws but arrow does not

There's a given MACD indicator , which has 4 buffers and 2 plots ( ExtFastMaHandle and ExtSlowMaHandle don't draw). Now I'm adding another 2 lines (actually 1 histogram and 1 line) and 2 arrows, making it 8 buffers and 6 plots. The following is my try. In OnCalculate(), with debugging, I found the 2

why arrow does not draw in indicator?

Just begin to learn mql5 , the following is a simple test, the data is there, why arrow just doesn't draw? #property indicator_chart_window #property indicator_buffers 1 #property indicator_plots 1 #property indicator_type1 DRAW_ARROW #property indicator_color1 clrWhite #property

close[] when converting mql4 to mql5 ?

Just began to learn how to convert mql4 to mql5. I learned how to deal with close[] in OnCalculate(......const double &close[], ......), with "ArraySetAsSeries()". But in my own function "draw()", I also have to use close[], so I tried : void draw( const double &close[]) { ArraySetAsSeries (close

what really happens when dragging another currency pair to current chart?

I just wrote an indicator for a friend, which draws several TEXT objects near/at each Low[] of several bars, only on D1 chart. I also added a fixed "padding" to move those objects a tiny bit away from Low[] price. This indicator works fine for me. But my friend has a habit: he often opens a chart

differentiate mouseclick and ctrl_mouseclick, my code does not work

void OnChartEvent ( const int id, const long &lparam, const double &dparam, const string &sparam) { string lastmove; if (id== CHARTEVENT_CLICK && lastmove!= "ctrl" ) { Print ( "clicked" ); lastmove="clicked"; } if (id==

array or loop problem?

Senario: in the current currency pair, open multiple positions, then manually close them one by one. The following function recountorders() works fine and I can test with ArrayRange(sl,0) showing order counts of the current currecy pair correctly, and it turns zero when all orders closed. int sl[][

(solved)array out of range? not price related, maybe about OrdersTotal

Please close this dumb question..... the last two lines, I should use poscount instead of i. I'm working on this code, using a CButton, my purpose: when new position (not including pending order) added to the current symbol, or stoploss changed in any of open position of the current symbol, this

ENUM font type does not work?

I did some search work, and the following code works with CButton font type: string FontType = "Calibri Bold" ; alertbutton.Font(FontType); However, my effort to make it an enum list failed: enum fonts { fntArial, // Arial Calibri Bold }; extern fonts FontType;