EA-39103 · Utility

NewBar

NewBar is a utility class that detects the formation of new bars on a specified chart timeframe. It provides a simple boolean method to check if the current tick belongs to a new bar, preventing multiple signal processing within the same bar. This is a foundational building block commonly used by other trading EAs to ensure one trade per bar.

Open the interactive view (equity curve, symbol switch)

Key facts

CategoryUtility
RiskSafe
Rating★★☆☆☆
TypeUtility tool
TimeframesM1, M5, M15, M30, H1, H4, D1
IndicatorsNone
AuthorCopyright \x00A9 2022, Fernando M. I. Carreiro, All rights reserved

Backtest results (H1, about 1 year)

Not backtested yet — this EA could not be converted automatically.

Strategy analysis

NewBar is not a trading strategy itself but a technical utility class designed to detect the formation of new bars on a chart. Its core concept compares the current bar's timestamp against a previously stored timestamp to determine whether a new bar has started. Entry conditions are not applicable since this tool does not execute any trading operations. Exit conditions are similarly not applicable. Position sizing and money management are not involved as the class solely provides time-detection functionality. This tool is typically called by other EAs to prevent duplicate order placement or redundant signal calculation within the same bar, making it an essential infrastructure component for building robust trading systems.

Strengths

  • Simple and efficient new bar detection mechanism that reduces duplicate signal processing
  • Modular design allowing easy integration and reuse by other EAs
  • Prevents the common problem of multiple entries within the same bar, improving system stability

Weaknesses

  • Provides only a single function with no trading logic included
  • Lacks support for simultaneous multi-timeframe bar detection
  • No error handling mechanism for timestamp anomalies or data refresh scenarios

Possible improvements

  • Add multi-timeframe new bar detection support to monitor multiple periods simultaneously
  • Implement IsNewBar callback event or signal mechanism for more flexible caller integration
  • Add handling logic for data refresh and anomalous timestamp situations

Risk assessment

Overall risk: Safe

  • This tool is a pure utility class with no trading risk involved
  • Must ensure callers correctly use the new bar flag, otherwise logic errors may occur

Evaluation scores

Code quality3.0
Strategy logic1.0
Risk management5.0
Robustness3.0
Innovation1.0
Documentation2.0
Overall2.5

Parameters

ParameterDefaultDescription
TimeframePERIOD_CURRENTTimeframe for new bar detection
LastBarTime0Timestamp of the last bar

Similar Utility EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.