Ating for MQL5
Loading...
Searching...
No Matches
LimitsByTimeRange Class Reference

Class to calculate price limits within a specific time range for a given symbol and timeframe. More...

+ Collaboration diagram for LimitsByTimeRange:

Classes

struct  Prices
 Structure to store the upper and lower price limits along with their datetimes. More...
 
struct  TimeRange
 Structure to store the start and end datetime for the time range. More...
 

Public Types

enum  ENUM_CHECK {
  PASSED , START_EQUAL_END , START_OVER_END , INCORRECT_FORMATTING ,
  RATES_NO_FOUND
}
 Enumeration for different check results. More...
 

Public Member Functions

 LimitsByTimeRange ()
 Default constructor for the LimitsByTimeRange class.
 
void UpdateAtr (uchar prev_start_hour, uchar prev_start_min, uchar prev_start_sec, uchar prev_end_hour, uchar prev_end_min, uchar prev_end_sec, ENUM_TIMEFRAMES timeframes_arg, string symbol_arg)
 Updates the attributes of the class.
 
Prices GetPricesStruct ()
 Retrieves the structure containing calculated price limits.
 
TimeRange GetTimeRangeStruct ()
 Retrieves the structure containing the time range used for calculations.
 
ENUM_CHECK CheckArg ()
 Checks the validity of the arguments for time range calculations.
 
string EnumCheckToString (ENUM_CHECK enum_result)
 Converts the ENUM_CHECK result to a human-readable string.
 
TimeRange GetTimeRange ()
 Calculates the time range based on the current and previous datetime settings.
 
Prices Get ()
 Retrieves the price limits within the specified time range.
 

Protected Member Functions

void Update ()
 Updates the start and end datetimes based on the previously set time parameters.
 

Protected Attributes

uchar previous_start_hour
 Previous start hour.
 
uchar previous_start_min
 Previous start minute.
 
uchar previous_start_sec
 Previous start second.
 
uchar previous_end_hour
 Previous end hour.
 
uchar previous_end_min
 Previous end minute.
 
uchar previous_end_sec
 Previous end second.
 
ENUM_TIMEFRAMES timeframes
 Timeframe for the symbol.
 
string symbol
 Trading symbol.
 
MqlDateTime start_datetime
 Start datetime for the calculation.
 
MqlDateTime end_datetime
 End datetime for the calculation.
 
MqlDateTime dt
 Current datetime.
 
MqlRates rates_limits []
 Array to store rates within the time range.
 
TimeRange time_range
 Time range for the calculation.
 
Prices prices
 Prices structure to hold calculated limits.
 

Detailed Description

Class to calculate price limits within a specific time range for a given symbol and timeframe.

Member Enumeration Documentation

◆ ENUM_CHECK

Enumeration for different check results.

Enumerator
PASSED 

Check for section time passed.

START_EQUAL_END 

Error: Start time is equal to end time.

START_OVER_END 

Error: Start time is over end time.

INCORRECT_FORMATTING 

Error: Incorrect formatting of time.

RATES_NO_FOUND 

Error: No rates found for the given time range.

Constructor & Destructor Documentation

◆ LimitsByTimeRange()

LimitsByTimeRange::LimitsByTimeRange ( )
inline

Default constructor for the LimitsByTimeRange class.

Member Function Documentation

◆ CheckArg()

LimitsByTimeRange::ENUM_CHECK LimitsByTimeRange::CheckArg ( )

Checks the validity of the arguments for time range calculations.

Returns
ENUM_CHECK result indicating the outcome of the check
+ Here is the call graph for this function:

◆ EnumCheckToString()

string LimitsByTimeRange::EnumCheckToString ( ENUM_CHECK enum_result)

Converts the ENUM_CHECK result to a human-readable string.

Parameters
enum_resultENUM_CHECK result
Returns
String representation of the ENUM_CHECK result

◆ Get()

LimitsByTimeRange::Prices LimitsByTimeRange::Get ( )

Retrieves the price limits within the specified time range.

Returns
Prices structure with the calculated upper and lower limits
+ Here is the call graph for this function:

◆ GetPricesStruct()

Prices LimitsByTimeRange::GetPricesStruct ( )
inline

Retrieves the structure containing calculated price limits.

Returns
Prices structure with the calculated limits

◆ GetTimeRange()

LimitsByTimeRange::TimeRange LimitsByTimeRange::GetTimeRange ( )

Calculates the time range based on the current and previous datetime settings.

Returns
TimeRange structure with the adjusted start and end times
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTimeRangeStruct()

TimeRange LimitsByTimeRange::GetTimeRangeStruct ( )
inline

Retrieves the structure containing the time range used for calculations.

Returns
TimeRange structure with the start and end times

◆ Update()

void LimitsByTimeRange::Update ( )
protected

Updates the start and end datetimes based on the previously set time parameters.

+ Here is the caller graph for this function:

◆ UpdateAtr()

void LimitsByTimeRange::UpdateAtr ( uchar prev_start_hour,
uchar prev_start_min,
uchar prev_start_sec,
uchar prev_end_hour,
uchar prev_end_min,
uchar prev_end_sec,
ENUM_TIMEFRAMES timeframes_arg,
string symbol_arg )

Updates the attributes of the class.

Parameters
prev_start_hourPrevious start hour
prev_start_minPrevious start minute
prev_start_secPrevious start second
prev_end_hourPrevious end hour
prev_end_minPrevious end minute
prev_end_secPrevious end second
timeframes_argTimeframe for the symbol
symbol_argTrading symbol

Member Data Documentation

◆ dt

MqlDateTime LimitsByTimeRange::dt
protected

Current datetime.

◆ end_datetime

MqlDateTime LimitsByTimeRange::end_datetime
protected

End datetime for the calculation.

◆ previous_end_hour

uchar LimitsByTimeRange::previous_end_hour
protected

Previous end hour.

◆ previous_end_min

uchar LimitsByTimeRange::previous_end_min
protected

Previous end minute.

◆ previous_end_sec

uchar LimitsByTimeRange::previous_end_sec
protected

Previous end second.

◆ previous_start_hour

uchar LimitsByTimeRange::previous_start_hour
protected

Previous start hour.

◆ previous_start_min

uchar LimitsByTimeRange::previous_start_min
protected

Previous start minute.

◆ previous_start_sec

uchar LimitsByTimeRange::previous_start_sec
protected

Previous start second.

◆ prices

Prices LimitsByTimeRange::prices
protected

Prices structure to hold calculated limits.

◆ rates_limits

MqlRates LimitsByTimeRange::rates_limits[]
protected

Array to store rates within the time range.

◆ start_datetime

MqlDateTime LimitsByTimeRange::start_datetime
protected

Start datetime for the calculation.

◆ symbol

string LimitsByTimeRange::symbol
protected

Trading symbol.

◆ time_range

TimeRange LimitsByTimeRange::time_range
protected

Time range for the calculation.

◆ timeframes

ENUM_TIMEFRAMES LimitsByTimeRange::timeframes
protected

Timeframe for the symbol.


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