Codes

Daily Pivot Points shifted for different day start time for MetaTrader 4

This indicator is another implementation of daily pivot points that allows the time for pivot point calculation to be advanced or delayed from the server time. It considers any Saturday trading to be Friday and any Sunday trading to be Monday

Forum

What's the difference between MODE_TICKSIZE & MODE_POINT?

Hi I was fascinated by the discussion provoked by phy on "What is a tick?" Basically, if a tick is an event, how can it have a size? What is the difference between MODE_TICKSIZE and MODE_POINT? I use this to calculate postiion/order size

Calling an overridden function from the overriding function?

Hi Is is possible to call a function in an inherited class from the function that overrides it? This is useful to avoid duplicating code when several classes inherit from one base class. A simple example is below. Thanks, Jellybean

Live Update to 251 didn't work

After the live update just released (build 251), running the terminal caused 100% CPU usage and required 'End Process' terminal.exe to recover. Uninstalling MT5, downloading from the web site and re-installing allowed it to run once. After closing, running the terminal again 100% CPU usage. 'End

Maximum number of indicator buffers?

Hi I thought I had read that the maximum umber of indicator buffers had changed in MQL5, but I can't find what I thought I read. Would someone please clarify what the maximum number of indicator buffers is? Thanks Jellybean

Correct usage of SERIES_SYNCRONIZED?

Hi In trying to prevent a divide by zero error, I realised that the indicator was calculating before the data was loaded or updated. I think I need to return without calculation if the data is not ready. I saw someone else use SeriesInfoInteger( NULL, 0, SERIES_SYNCRONIZED ), but is this the correct

How to find height of window in pixels?

Hi all Does anyone know of a way of finding out how many pixels there are between the maximum and minimum prices on the chart window? All I can find is WindowPriceMax() & WindowPriceMin(), which return price units. Cheers Jellybean

Bug or me?

Hi I have a problem where the spread data in the OnCalculate() parameters sometimes is equal to -bid. It behaves as though the ask value is zero. When I calculate the spread using the MqlTick values I have no error. I will attach my test indicator and the output in Experts tab. Do others have this

Strange results from iLowest()??

Hi I trying to use the lowest low over the previous 10 bars, but I am getting strange results from iLowest(). Do others have this problem? Am I doing something wrong? It appears to mix up the type constants. I've tested it on M1 & M5 because they move faster

Can trailing stop in the client terminal be set from in an EA?

Hi I'm trying to write a simple EA to manage an entry. When the entry order is placed I would like to add a trailing stop in the same way that you can by right-clicking on the order in the client terminal. (I understand that the Client Terminal handles the trailing stop, not the server.) This way

Avoiding excessive queries to the server?

Hi Does the function MarketInfo ( Symbol(), MODE_SPREAD ) query the server or client terminal? When working with a very volatile spread (e.g. AUDNZD) I find I want to average the spread tick by tick, but does that mean I'm making server requests every tick? I'm happy to pester the client terminal