Files
Bell-PriceActionWithEma-EA/Experts/EA_ICT_CL/Indicators.mqh
T
2026-03-10 19:28:06 +07:00

23 lines
1.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef EA_ICT_CL__INDICATORS_MQH
#define EA_ICT_CL__INDICATORS_MQH // Tránh include trùng
// Module: Indicators copy dữ liệu buffer/time an toàn (series index 0 = mới nhất)
inline bool CopyBufferSafe(const int handle, const int buffer, const int start_pos, const int count, double &out[])
{
if (handle == INVALID_HANDLE) return false; // Handle không hợp lệ
ArraySetAsSeries(out, true); // Index 0 = bar mới nhất
const int copied = CopyBuffer(handle, buffer, start_pos, count, out); // Copy dữ liệu indicator
return (copied == count); // Thành công khi copy đủ count phần tử
}
inline bool CopyTimeSafe(const string symbol, const ENUM_TIMEFRAMES tf, const int start_pos, const int count, datetime &out[])
{
ArraySetAsSeries(out, true); // Index 0 = bar mới nhất
const int copied = CopyTime(symbol, tf, start_pos, count, out); // Copy thời gian mở bar
return (copied == count); // Thành công khi copy đủ count
}
#endif // EA_ICT_CL__INDICATORS_MQH