Chat GPTで移動平均線インジケーターを作ってみた

今、話題のChat GPTで日本語だけで移動平均を描画するインジケーターを作ってみました。

問題なくできました。

命令の仕方や時間帯で異なるコードが出てきます。

今回のコード

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Lime

extern int MA_Period = 20;

double MA_Buffer[];

int init()
{
SetIndexBuffer(0, MA_Buffer);
SetIndexStyle(0, DRAW_LINE);
SetIndexLabel(0, “MA”);
IndicatorDigits(Digits + 1);
return 0;
}

int start()
{
int limit = Bars – IndicatorCounted();
if (limit < 1) return 0;

for (int i = limit; i >= 0; i–)
{
MA_Buffer[i] = iMA(NULL, 0, MA_Period, 0, MODE_SMA, PRICE_CLOSE, i);
}

return 0;
}

どこまで出来るか次回をお楽しみに!

コメントを残す