Codes

Solar Wind Indicator for MQ5 for MetaTrader 5

This is a re-write of the old Solar Winds indicator for MQ5. There has recently been some 'excitement' about using this with other indicators for entry signals, and after a request to develop an indicator using it, I found that it was a classic re-painter - so I am contributing this code with an

ZigZag Semaphore ( semafor ) Indicator for MetaTrader 4

This indicator places a mark (a semaphore) at the zig zag for each of 4 zig zag evaluation lengths

SeriesIntegerInfo and Rates Bar Information Utility, displays how many bars there are in all timeframes for any user selected symbol, and shows the 'CopyRates' information availablity for any bar for MetaTrader 5

This utility is not a trading information utility. It will only have value for those getting information on the Number of Bars that have terminal data. This utility uses the functions SeriesIntegerInfo and CopyRates to obtain and display information about the availability of bar information from the

Bars and Rates Information Utility, displays how many bars there are in all timeframes for any user selected symbol, and shows the 'CopyRates' information availablity for any bar for MetaTrader 5

This utility is not a trading or market information utility. This will likely only interest those writing (or debugging) indicators using multiple timeframes and collecting information using Bars (or iBars) and CopyRates. The utility creates a list showing the number of Bars reported by the "Bars"

Utility to view the statistics for a Single Bar of any time frame for MetaTrader 5

The utility will display the high, low, open, close and time statistics for any user selected bar of any timeframe for the symbol of the chart the utility resides on

Basket Viewer-View Statistics on groups of Long and Short Pairs for MetaTrader 5

This utility allows monitoring of multiple symbols and positions on one chart with one-click switching of the chart symbol

Basket Viewer-View Statistics on groups of Long and Short Pairs for MetaTrader 4

User may enter up to 50 symbols from their market watch in either a long or short basket for viewing. The symbols for the chart can be changed to any symbol in the display with a click on the symbol. Statistics including ATR for the chart period, points gained or lost from a weeks start and position

Singleton Example for MetaTrader 5

This is a working singleton code example. The sole purpose of this post is to provide a working code sample of a singleton object. A singleton object is created when there 'can be only one' of the object. This is accomplished by making an object's constructor private, and ensuring assignment and

View the Value in OnCalculate Parameters for MetaTrader 5

This is a utility for beginning indicator programmers, or others, that want to have a look at values provided by OnCalculate and a few other functions. The indicator shows: 1) The most recent value provided with the most recent OnCalculate call. 2) The previous value from the previous OnCalculate

NonLagMA with ATR Bands and Control Panel for MetaTrader 5

This is a re-write of the nonLagMA found elsewhere and includes several uncommonly shown coding options, including a simple control dashboard

Forum

Use DRAW_COLOR_LINE and DRAW_COLOR_HISTOGRAM together

See https://www.mql5.com/en/code/34815 I wonder if this shows a bug, lack of understanding or MQ5 limitation, I have a Color Line and a Color Histogram defined. They both work fine independently, but only one will display when they are both 'on'. Here is the definition: #property

MQL5: How do I initialize data for CopyRates, Bars and iBars?

I'm Looking for help on how to initialize terminal data before OnCalculate is called. Attached is a sample indicator and associated log file showing the errors posted - I thought that after calling CopyRates for an 'old' bar, eventually the data would download and things would start working - but

const correctness: call non-const method for constant object

Trying some 'const correctness' in my code - and getting "call non- const method for constant object" class someClass { ... public: int getSomePrivateInt(void){ return( somePrivateInt ); } } *someClassPtr; class otherClass { ... void otherClassFunction( const someClass* theClass ) // also

Using OnCalculate

Please find attached an indicator that does nothing but display the values passed to OnCalculate - and a few other values from functions common in indicator development. Question: Why, when accessing volume[] or spread[] do I get an 'index out of range error'? Are these values not supported in

Assinging Variable References and returning them from functions in MQL4

datetime DayOneArray[] = { D'0000.00.00 00:00:00' , D'0000.00.00 00:00:00' }; // no valid time identified on this day datetime DayTwoArray[] = { D'0000.00.00 05:45:00' , D'0000.00.00 15:00:00' }; Etc. So then we have function: void DoSomethingOnDay( int day) { datetime TimeArray[]; // cannot