質問編集履歴

2

個人情報保護tのため

2022/04/27 12:01

投稿

fxtrader.masa
fxtrader.masa

スコア34

test CHANGED
@@ -1 +1 @@
1
- MT4 ChartID についてchart not found:4211
1
+ MT4の機能のエラーについて
test CHANGED
File without changes

1

個人情報があったため

2022/04/27 11:55

投稿

fxtrader.masa
fxtrader.masa

スコア34

test CHANGED
File without changes
test CHANGED
@@ -1,46 +1,6 @@
1
- MT4 ChartID についてchart not found:4211
2
-
3
- >背景
1
+ MT4
4
- 普通に稼働はするのですが
5
- エラーを取得できてしまいます。
6
- for文が間違っているかと思います。
7
-
8
- >エラー文章
9
- chart not found:4211
10
-
11
2
  >環境
12
3
  Windows10
13
4
  MetaTrader4 build 1355
14
5
  FXTF社
15
6
 
16
- >参考サイト
17
- https://uhoho.hatenablog.jp/entry/2020/09/11/235046
18
- こちらのサイトの2つを試しましたが、両方とも稼働はしますがエラーも取得できます。
19
- MetaTrade4 MQL MT5 FX トレード MetaEditor
20
-
21
- >書いたコード(インジケータファイル)
22
- ```
23
- #property indicator_chart_window
24
- #include <stderror.mqh>
25
- #include <stdlib.mqh>
26
- #include <WinUser32.mqh>
27
- #import "user32.dll"
28
- int MessageBoxW(int hWnd, string lpText, string lpCaption, int uType);
29
- #import
30
-
31
- int start()
32
- {
33
- //ChartID
34
- int n = 1;
35
- for(long nextchart = ChartNext(ChartFirst()); nextchart != -1; nextchart = ChartNext(nextchart))
36
- {
37
- printf("%d回目", n);
38
- n++;
39
- }
40
- //errorチェック
41
- int error = GetLastError();
42
- if(error>0) {Alert(ErrorDescription(error)+":"+error);}
43
- return(0);
44
- }
45
- ```
46
-