Loong / Publications
Codes
DemoBufferPattern for MetaTrader 5
To demo buffer-pattern: Candles + Fractals + ZigzagColor + ColorMaLine
LoongMAx96 for MetaTrader 5
Draws 96 line MAs with only 100 lines of code (uses CMyBuffer class)
LoongClock for MetaTrader 5
A very simple sample of clock
Articles
The Drawing Styles in MQL5 for MetaTrader 5
There are 6 drawing styles in MQL4 and 18 drawing styles in MQL5. Therefore, it may be worth writing an article to introduce MQL5's drawing styles. In this article, we will consider the details of drawing styles in MQL5. In addition, we will create an indicator to demonstrate how to use these
Forum
question about Ichimoku
I change the example of Ichimoku indicator . It work well. However, there are two questions. How to fill the cloud between SpanA and SpanB with STYLE_DOT like the built-in indicator? How to make indicator support shift beyond series with CopyBuffer()
Build 257, Access violation read in visitting const string in a dual const struct array
Print ( "VisitIndiParam{for}, rcaIndiParam.aIndiParam[i].string_value=" +rcaIndiParam.aIndiParam[i].string_value); This code work well before Build 252, but cause "Access violation read" in Build 256 and 257. (I did not test Build 253, 254 and 255.) You can visit a const array of MqlParam , but if
Build 257, HISTOGRAM2 bug
DRAW_HISTOGRAM2 DRAW_COLOR_HISTOGRAM2
How to remove levels of a indicator at runtime?
If I set levels of a indicator, how to remove them at runtime? //--- set levels IndicatorSetInteger ( INDICATOR_LEVELS ,2); IndicatorSetDouble ( INDICATOR_LEVELVALUE ,0,20.0); IndicatorSetDouble ( INDICATOR_LEVELVALUE ,1,80.0);
DoubleToString() digits default value is 0?
MQL5 document said the default value is 8, but seem actually set 0 as default. DoubleToString Converting numeric value into text string. string DoubleToString ( double value , // number int digits=8 // number of digits after decimal point ); You can test the Script
question about IndicatorSetXXX
Why there are not IndicatorGetXXX function ? How to get MAXIMUM or MINIMUM of a indicator? If I set MAXIMUM or MINIMUM of a indicator, how to clear them at runtime? If I set some levels of a indicator, how to delete these levels at runtime
three question from IndicatorCreate()
1. do not support "[]&" grammar In MQL5 Reference / Timeseries and Indicators Access / IndicatorCreate, there is: int IndicatorCreate ( string symbol, // symbol name ENUM_TIMEFRAMES period, // timeframe ENUM_INDICATOR
How to publicize the m_data[], when derive a class from CArrayDouble?
I need a public buffer to use in CLoongIndiSelect::GetData(). I can define a public buffer, but there is a double m_data[]. So, why do not use it? // CLoongIndiBuffer << CIndicatorBuffer << CArrayDouble << CArray << CObject // need a public buffer protected // to use in
tree optimize error!
If you compile this code, it will cause tree optimize error, and crash MetaEditor (5.0.0.244)! void TestMath6( long lParam) { //if directly assign value to lLocal, will cause //tree optimize error 1 1 //long lLocal=lParam; long lLocal= 555 ; long l_l_2; l_l_2 = (
MathFloor(), MathCeil() return wrong value
MathFloor(any value) return 0. MathCeil (any value) return 1. MathRound() is right