MT4 天才きてください!ネットのコードがどれもエラーになります。
背景
ChartID、ChartNext()の勉強をしていたのですが
ネットで見るコードはすべて
chart not found:4211
というエラーがでます。
どこを直したらよいでしょうか?
ちなみにちゃんと普通にChartIDは取得できるのですが
for文が少し違うのか、エラーもでてきます
環境
Windows10
MetaTrader4 build 1355
FXTF社
参考サイト
https://uhoho.hatenablog.jp/entry/2020/09/11/235046
こちらのサイトの2つを試しましたが、両方ともエラーが出ます。
MetaTrade4 MQL MT5 FX トレード MetaEditor
書いたコード(インジケータファイル)
#property indicator_chart_window #include <stderror.mqh> #include <stdlib.mqh> #include <WinUser32.mqh> #import "user32.dll" int MessageBoxW(int hWnd, string lpText, string lpCaption, int uType); #import int start() { //ChartID int n = 1; for(long nextchart = ChartNext(ChartFirst()); nextchart != -1; nextchart = ChartNext(nextchart)) { printf("%d回目", n); n++; } //errorチェック int error = GetLastError(); if(error>0) {Alert(ErrorDescription(error)+":"+error);} return(0); }
あなたの回答
tips
プレビュー