Skip to content
All library documents

A Chart Template for Viewing Candles and Trade Entry and Exit Points

Article FMZ forum · Author: 发明者量化-小小梦

Summary

This note introduces a charting template intended to make strategy behavior easier to inspect during development and live monitoring. It draws real-time candlesticks and marks entries and exits on the chart. The author motivates the tool with a double moving average strategy, where reviewing logs alone made it difficult to see when trades occurred. Two helper functions are described: one draws chart records, and the other places a trade marker using time, price, amount, and trade state.

An example shows where to call the drawing function within the main strategy loop and where to record markers after opening or closing a position. The example uses moving average crossovers for entries and exits, with position state controlling the direction of the closing trade. The post includes chart images, but gives no quantitative evidence or systematic evaluation. The author says the template had received little testing and lacked planned features such as overlaying custom indicators, so it should be treated as a learning aid rather than a production-ready tool.

Key ideas

  • The template displays live candlesticks and marks strategy entries and exits on the chart.
  • A drawing helper runs inside the main loop, while a marker helper records trade details after orders.
  • The example integrates the chart with a double moving average strategy and state-based position handling.
  • The post provides illustrative charts but no measured evidence that the template improves trading results.
  • The author describes the code as lightly tested and incomplete, with further indicator display features planned.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.