MCPcopy Create free account
hub / github.com/NoFxAiOS/nofx / writeAvailableIndicators

Method writeAvailableIndicators

kernel/engine_prompt.go:639–712  ·  view source on GitHub ↗
(sb *strings.Builder, zh bool)

Source from the content-addressed store, hash-verified

637}
638
639func (e *StrategyEngine) writeAvailableIndicators(sb *strings.Builder, zh bool) {
640 indicators := e.config.Indicators
641 kline := indicators.Klines
642
643 label := func(en, zhStr string) string {
644 if zh {
645 return zhStr
646 }
647 return en
648 }
649
650 if zh {
651 sb.WriteString(fmt.Sprintf("- %s price series", kline.PrimaryTimeframe))
652 if kline.EnableMultiTimeframe {
653 sb.WriteString(fmt.Sprintf(" + %s K-line series\n", kline.LongerTimeframe))
654 } else {
655 sb.WriteString("\n")
656 }
657 } else {
658 sb.WriteString(fmt.Sprintf("- %s price series", kline.PrimaryTimeframe))
659 if kline.EnableMultiTimeframe {
660 sb.WriteString(fmt.Sprintf(" + %s K-line series\n", kline.LongerTimeframe))
661 } else {
662 sb.WriteString("\n")
663 }
664 }
665
666 if indicators.EnableEMA {
667 sb.WriteString("- " + label("EMA indicators", "EMA indicators"))
668 if len(indicators.EMAPeriods) > 0 {
669 sb.WriteString(fmt.Sprintf(" (%s: %v)", label("periods", "periods"), indicators.EMAPeriods))
670 }
671 sb.WriteString("\n")
672 }
673 if indicators.EnableMACD {
674 sb.WriteString("- " + label("MACD indicators", "MACD indicators") + "\n")
675 }
676 if indicators.EnableRSI {
677 sb.WriteString("- " + label("RSI indicators", "RSI indicators"))
678 if len(indicators.RSIPeriods) > 0 {
679 sb.WriteString(fmt.Sprintf(" (%s: %v)", label("periods", "periods"), indicators.RSIPeriods))
680 }
681 sb.WriteString("\n")
682 }
683 if indicators.EnableATR {
684 sb.WriteString("- " + label("ATR indicators", "ATR indicators"))
685 if len(indicators.ATRPeriods) > 0 {
686 sb.WriteString(fmt.Sprintf(" (%s: %v)", label("periods", "periods"), indicators.ATRPeriods))
687 }
688 sb.WriteString("\n")
689 }
690 if indicators.EnableBOLL {
691 sb.WriteString("- " + label("Bollinger Bands (BOLL) - Upper/Middle/Lower bands", "Bollinger Bands (BOLL) - Upper/Middle/Lower bands"))
692 if len(indicators.BOLLPeriods) > 0 {
693 sb.WriteString(fmt.Sprintf(" (%s: %v)", label("periods", "periods"), indicators.BOLLPeriods))
694 }
695 sb.WriteString("\n")
696 }

Callers 1

BuildSystemPromptMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected