Start from scratch to write the first metric - Advanced version.

CN
2 hours ago

Many students often encounter four types of problems when autonomously writing custom indicators: excessive and chaotic signals, extremely scarce signals, frequent signal failures, and complete lack of signals. In today's advanced lesson, we will specifically teach you how to precisely troubleshoot problems and scientifically optimize parameters, without blindly adding conditions or modifying code, easily refining high-quality indicators suitable for real trading.

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image1

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image2

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image3

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image4

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image5

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image6

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image7

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image8

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image9

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image10

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image11

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image12

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image13

Writing the First Indicator from Scratch - Advanced Version_aicoin_Image14

 

1. Precision Troubleshooting Logic for Four Major Indicator Issues

1. Too Many Chaotic and Ineffective Signals

The core reason is not that the code is too simple, but rather that the filtering conditions are too lenient. Prioritize examining three core dimensions: trend filtering rules, pullback determination standards, and confirmation thresholds for RSI and volume. The optimization principle is to fine-tune parameters and tighten rules without adding unnecessary conditions. Blindly stacking conditions will only disrupt the original indicator logic and damage overall adaptability; just tightening loose parameters can filter out ineffective noise.

2. Too Few and Hardly Triggered Signals

This is the opposite of having too many signals, with the problem lying in the various judgment conditions being set too strictly. Optimization should avoid broadly relaxing parameters all at once; the correct approach is to test and troubleshoot one by one, identifying whether the trend, pullback, volume, or RSI conditions are too restrictive, then fine-tuning the corresponding parameters while retaining other core rules to precisely correct the issues.

3. Frequent Signal Failures

The core of the failure is that the market has broken through the trend bottom line of the indicator, focusing on the situation of support breaking for moving averages. If the price breaks below the 20-day moving average, it indicates the logic for short-term pullback support has failed, and the current market does not meet the entry conditions; if it further breaks below the 60-day moving average, it means the overall trend has completely reversed from upward to downward, invalidating all existing long signals and requiring immediate abandonment of operations.

4. Complete Lack of Signal Output

Directly deconstruct the four core conditions to troubleshoot individually: trend conditions, pullback conditions, stable moving average conditions, and RSI + volume confirmation conditions. Verify which condition has not met standards, accurately locate blockages, and there is no need to modify the entire code; targeted optimization can restore signal output.

2. Visualized Troubleshooting Method (A Must for Beginners)

To facilitate intuitive troubleshooting of issues, we can deconstruct the entire indicator logic into "four signal lights," using the code's ternary operator (question mark determination logic) to automatically identify whether conditions are met and visually present all rules:

Trend light: Determines whether the price is stabilized above the 60-day moving average, displaying blue if met;

Pullback light: Determines whether the previous K-line has pulled back below the 20-day moving average, displaying yellow if met;

Stable light: Determines whether the price has crossed back above and stabilized above the 20-day moving average, displaying green if met;

Confirmation light: Determines whether the RSI and volume are synchronously met as the final signal verification.

The core of this logic is: if conditions are met, the corresponding color signal is displayed; if not met, there is no output. When editing indicators in the client, users can manually pull up the 20-day and 60-day moving averages, customize line colors, and clearly compare the condition meeting status for each segment of market conditions, quickly identifying code vulnerabilities and parameter issues.

3. Detailed Operational Rules for Indicator Optimization

Indicator optimization has a fixed priority, and remember the core principle: first adjust parameters, then add conditions; small steps of iteration, single micro adjustments.

The first step is to fine-tune basic parameters: If signals are chaotic, tighten the volume threshold, for example, adjusting the volume comparison from the 120-day average to the 180-day average, or raising the standard for volume proportion to filter small false signals without volume; if signals are too few, then moderately relax corresponding parameters to restore the normal triggering frequency.

The second step considers adding or reducing logical conditions: If fine-tuning parameters still proves ineffective (signals continue to fail or there are completely no signals), then add auxiliary filtering conditions, such as superimposing the 10-day moving average, using MACD for trend assistance, or adding more RSI range limitations, stacking multiple conditions to validate and enhance signal stability.

A complete closed-loop logic for indicators can refer to this standard:

Entry conditions = Trend met + Pullback action + Stable moving average + Dual confirmation of volume and RSI

Exit conditions = Price falling below the 20-day moving average (short-term breakdown) / falling below the 60-day moving average (trend reversal)

4. Practical Tools for Beginners with No Coding Skills

For beginners who cannot handwrite code, there’s no need to struggle with complex programming; the platform comes with a full set of tools to easily achieve indicator writing, backtesting, and real trading application:

1. Massive Templates for Direct Use: The indicator editing page includes official finished templates, such as Super Trend, MA moving averages, MACD, and Band Strategies, that can be activated with one click. Users can freely modify periods, parameters to adapt to various trading styles. There's also community-shared indicators, including free and paid types that can be directly referenced and used.

2. Strategy Backtesting to Verify Quality: All custom indicators and applied templates can utilize the backtesting feature to simulate operations in historical markets, checking past win rates and stability, avoiding pitfalls in real trading and selecting quality strategies.

3. AI Smart Indicator Writing (Limited Time Free): For those who do not understand code or parameter tuning, directly use the AI indicator writing functionality. Just express your trading logic in plain language, such as "buy when oversold stabilizes, enter on breakout with volume," and the AI will automatically generate complete indicator code without manual writing, allowing beginners to quickly get started.

4. Batch Screening of Coins in Real Trading: Meeting indicators can screen all trading pairs across exchanges with the defined conditions at one click, eliminating the need for manual chart inspection and efficiently locking in quality trading targets, while also supporting real-time monitoring of 30 custom indicators to track trading signals throughout the process.

5. Final Summary and Q&A Channels

Summary of the core logic for indicator optimization: Tighten parameters when signals are numerous, relax threshold parameters when signals are few, check moving average trends when signals fail, and deconstruct the four major conditions when there are no signals. Maintain a consistent approach of small-step optimizations, not blindly modifying code or randomly adding logic, and gradually refine strategies.

If you have any questions during the process of writing indicators, tuning parameters, or using them, you can join the live broadcast community to receive course templates, live replay, and consult for answers anytime, continuously improving the indicator trading system.

TG live group: https://t.me/+DWQDvFSutJs5ZjU1
AiCoin live group: https://www.aicoin.com/link/chat?cid=enjLWN3pz​​​​​​​Writing the First Indicator from Scratch - Advanced Version_aicoin_Image15

Currently, there are live broadcasts every day, welcome to keep following the AiCoin team! Reserve in advance👇

https://www.aicoin.com/zh-Hans/live/list?tab=upcoming

Join our community to discuss and become stronger together!

Official Telegram group: https://t.me/aicoincn
AiCoin Chinese Twitter: https://x.com/AiCoinzh

This article represents the author's personal opinion and does not reflect the platform's stance and views. This article is for information sharing only and does not constitute investment advice for anyone.

免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。

Share To
APP

X

Telegram

Facebook

Reddit

CopyLink