MT4 Floating Charts Extension API
Access and/or extend MT4 Floating Charts functionality
Public Member Functions | List of all members
FloatingCharts Class Reference

Class to interface with MT4 Floating Charts. More...

Public Member Functions

 FloatingCharts (void)
 Constructor. More...
 
int Init (void)
 Initialize non-constant members. More...
 
int Float (long chart_id) const
 Float a single chart. More...
 
int FloatAll (void) const
 Float all docked charts except for the currently active chart. More...
 
int Unfloat (long chart_id) const
 Unfloat a single chart. More...
 
int UnfloatAll (void) const
 Unfloat all floating charts. More...
 
int CornerSnap (long chart_id, int corner) const
 Snap a floating chart to a screen corner. More...
 
int PushBack (long chart_id) const
 Push a floating chart behind all windows. More...
 
int ShowChartsSameSymbol (long chart_id) const
 Bring all floating charts with the same symbol as the given chart forward. More...
 
int StackChartsSameSymbol (long chart_id) const
 Stack all floating charts with the same symbol as the given chart. More...
 
bool IsFCRunning (void) const
 Check if MT4 Floating Charts is running. More...
 
int WaitForFC (uint timeout) const
 Wait for MT4 Floating Charts to attach to MetaTrader. More...
 
bool IsChartFloating (long chart_id) const
 Check if a chart is floating. More...
 
string GetFCVersionString (void) const
 Get MT4 Floating Charts version as a string. More...
 
string GetAPIVersionString (void) const
 Get the FloatingCharts API version as a string. More...
 
bool RequiresFC (int major, int minor, int patch, bool do_alert) const
 Check if MT4 Floating Charts meets the minimum version requirement. More...
 

Detailed Description

Class to interface with MT4 Floating Charts.

Constructor & Destructor Documentation

FloatingCharts::FloatingCharts ( void  )

Constructor.

Initializes constants and calls Init().

Member Function Documentation

int FloatingCharts::CornerSnap ( long  chart_id,
int  corner 
) const

Snap a floating chart to a screen corner.

Corresponds to the custom toolbar buttons 1,2,3,4.

Parameters
longchart_id - chart id. 0 means the current chart. Applies only to undocked (floating) charts.
intcorner - screen corner to snap to. Valid values are 0-3.
Returns
FC_ERR_SUCCESS on success.
A non-zero FCErrorCode if an error was encountered.
Minimum MT4 Floating Charts Version: 2.1.0
int FloatingCharts::Float ( long  chart_id) const

Float a single chart.

Parameters
longchart_id - chart id. 0 means current chart. Applies only to docked charts.
Returns
FC_ERR_SUCCESS on success.
A non-zero FCErrorCode if an error was encountered.
int FloatingCharts::FloatAll ( void  ) const

Float all docked charts except for the currently active chart.

Returns
FC_ERR_SUCCESS on success.
A non-zero FCErrorCode if an error was encountered.
string FloatingCharts::GetAPIVersionString ( void  ) const

Get the FloatingCharts API version as a string.

Returns
API version string as 'major.minor.patch'.
string FloatingCharts::GetFCVersionString ( void  ) const

Get MT4 Floating Charts version as a string.

Note
If the version requirement is not met, then nothing is copied to str.
Returns
Version string as 'major.minor.patch'.
NULL if Floating Charts version below 3.2.0.
Minimum MT4 Floating Charts Version: 3.2.0
int FloatingCharts::Init ( void  )

Initialize non-constant members.

Note
This method is called in the constructor for convenience. However, it is safe to call it again to check for errors.
Returns
FC_ERR_SUCCESS on success.
A non-zero FCErrorCode if an error was encountered.
bool FloatingCharts::IsChartFloating ( long  chart_id) const

Check if a chart is floating.

Parameters
longchart_id - chart id. 0 means the current chart.
Returns
true if the given chart is floating. Otherwise, false.
bool FloatingCharts::IsFCRunning ( void  ) const

Check if MT4 Floating Charts is running.

Returns
true if Floating Charts is attached to MetaTrader. Otherwise, false.
Minimum MT4 Floating Charts Version: 2.4.0
int FloatingCharts::PushBack ( long  chart_id) const

Push a floating chart behind all windows.

Corresponds to the custom toolbar button 'PB'.

Parameters
longchart_id - chart id. 0 means the current chart. Applies only to undocked (floating) charts.
Returns
FC_ERR_SUCCESS on success.
A non-zero FCErrorCode if an error was encountered.
Minimum MT4 Floating Charts Version: 2.4.0
bool FloatingCharts::RequiresFC ( int  major,
int  minor,
int  patch,
bool  do_alert 
) const

Check if MT4 Floating Charts meets the minimum version requirement.

If the minimum version is less than 3.2.0, the return value will always be true regardless of what version of FC is actually running.

Parameters
intmajor - major part of version number (e.g., 3 in 3.4.5).
intminor - minor part of version number (e.g., 4 in 3.4.5).
intpatch - patch part of version (e.g., 5 in 3.4.5).
booldo_alert - if true, a standard alert is shown if the minimum version requirement is not met.
Returns
true if MT4 Floating Charts is >= minimum version. Otherwise, false.
Minimum MT4 Floating Charts Version: 3.2.0
int FloatingCharts::ShowChartsSameSymbol ( long  chart_id) const

Bring all floating charts with the same symbol as the given chart forward.

Corresponds to the custom toolbar button 'S*'.

Parameters
longchart_id - chart id. 0 means the current chart. Applies only to undocked (floating) charts.
Returns
FC_ERR_SUCCESS on success.
A non-zero FCErrorCode if an error was encountered.
Minimum MT4 Floating Charts Version: 2.4.0
int FloatingCharts::StackChartsSameSymbol ( long  chart_id) const

Stack all floating charts with the same symbol as the given chart.

Corresponds to the custom toolbar button '[S]'.

Parameters
longchart_id - chart id. 0 means the current chart. Applies only to undocked (floating) charts.
Returns
FC_ERR_SUCCESS on success.
A non-zero FCErrorCode if an error was encountered.
Minimum MT4 Floating Charts Version: 3.1.0
int FloatingCharts::Unfloat ( long  chart_id) const

Unfloat a single chart.

Parameters
longchart_id - chart id. 0 means current chart. Applies only to undocked (floating) charts.
Returns
FC_ERR_SUCCESS on success.
A non-zero FCErrorCode if an error was encountered.
int FloatingCharts::UnfloatAll ( void  ) const

Unfloat all floating charts.

Returns
FC_ERR_SUCCESS on success.
A non-zero FCErrorCode if an error was encountered.
int FloatingCharts::WaitForFC ( uint  timeout) const

Wait for MT4 Floating Charts to attach to MetaTrader.

Does not return until either MT4 Floating Charts is detected or the timeout is reached.

Parameters
uinttimeout - timeout in milliseconds. 0 means no timeout.
Returns
FC_ERR_SUCCESS if MT4 Floating Charts is detected.
FC_ERR_NOT_RUNNING if the timeout is reached.
Minimum MT4 Floating Charts Version: 2.4.0

The documentation for this class was generated from the following file: