私のアプローチコアはエンジンです。 - ページ 95 1...888990919293949596979899100101102...184 新しいコメント Vasiliy Sokolov 2018.12.20 14:57 #941 Реter Konow:労働組合もすでに整理してある。 最後まで把握できていない。 それはおかしい。 Char_Uint u; uint width,height; string Message; //----------------------------- if(!ResourceReadImage("\\Experts\\Tester EA.ex4::Resource",u.Uint,width,height))Print("Failed to read resource! ",GetLastError()); //----------------------------- Message = CharArrayToString(u.Char); //----------------------------- Print(Message); そうですね。 Char_Uint u; uint width,height; string Message; //----------------------------- if(!ResourceReadImage("\\Experts\\Tester EA.ex4::Resource",u.Uint,width,height))Print("Failed to read resource! ",GetLastError()); //----------------------------- double bid = u.Double; //----------------------------- Print(DoubleToString(bid)); そして、コードの不注意は?受信者と送信者で異なるChar_Uint構造体を持っている! Реter Konow 2018.12.20 15:15 #942 Vasiliy Sokolov:最後まで正確に把握できていない。 それはおかしい。 そうですね。 そして、コードの不注意は?受信者と送信者で異なるChar_Uint構造を持っているのですね!ありがとう、ヴァシリー。必要であることを知りませんでした。構造体が同じであるバリエーションも試しましたが。 とにかく、出力結果が私の望むものではありません。以下はそのコードです。 //+------------------------------------------------------------------+ //| Tester EA.mq4 | //| Peter Konow | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Peter Konow" #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ union Char_Uint { uchar Char[8]; uint Uint[2]; double Double; }; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //---------------------------------------------- if(!ObjectCreate(0,"Resource",OBJ_BITMAP_LABEL,0,0,0))Print("Object is not created! ",GetLastError()); else Print("Object created!"); //------------------------------- if(!ObjectSetString(0,"Resource",OBJPROP_BMPFILE,"::Resource"))Print("BMPFILE is not created!"); else Print("BMPFILE created!"); //---------------------------------------------- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- destroy timer } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--------------------------- Char_Uint u; //--------------------------- u.Double = Bid; //--------------------------- if(!ResourceCreate("::Resource",u.Uint,2,1,0,0,0,COLOR_FORMAT_XRGB_NOALPHA))Print("Resource is not created!"); //--------------------------- } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { //--- } //+------------------------------------------------------------------+ そして、受け手。 //+------------------------------------------------------------------+ //| Resource reader.mq4 | //| Peter Konow | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Peter Konow" #property link "https://www.mql5.com" #property version "1.00" #property strict #property indicator_chart_window //+------------------------------------------------------------------+ union Char_Uint { uchar Char[8]; uint Uint[2]; double Double; }; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping EventSetMillisecondTimer(5250); if(!ObjectSetString(0,"Resource",OBJPROP_BMPFILE,"\\Experts\\Tester EA.ex4::Resource"))Print("Resource is not connected!"); else Print("Resource connected!"); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { Char_Uint u; uint width,height; string Message; //----------------------------- if(!ResourceReadImage("\\Experts\\Tester EA.ex4::Resource",u.Uint,width,height))Print("Failed to read resource! ",GetLastError()); //----------------------------- double bid = u.Double; //----------------------------- Print(DoubleToString(bid,5)); } //+------------------------------------------------------------------+ 結果 2018.12.20 17:13:37.395 Resource reader GBPUSD,M5: 9223464270575144355.75808 でも、少なくとも変わりはしない。値は一定です。(ただし、Bid値の変更に伴って変更されるはずです)。 Vasiliy Sokolov 2018.12.20 15:23 #943 Реter Konow:でも、少なくとも変わりはしない。値は一定です。(ただし、Bid値の変更に伴い、変更されるはずです)。私のコンピュータでのあなたの例は正しく動作しているので、これは非常に奇妙です。エキスパートを作るために両方試して、2つのチャートに簡単に配置します。 Реter Konow 2018.12.20 15:25 #944 Vasiliy Sokolov:私のコンピュータでのあなたの例は正しく動作しているので、これは非常に奇妙です。エキスパートを作るのと、2つのチャートだけを配置するのと、両方試してみてください。オッケーです。 Реter Konow 2018.12.20 15:28 #945 以下は、2つ目のグラフの2つ目のEAのコードです。結果は同じ... //+------------------------------------------------------------------+ //| Tester EA 2.mq4 | //| Peter Konow | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Peter Konow" #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ union Char_Uint { uchar Char[8]; uint Uint[2]; double Double; }; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping if(!ObjectSetString(0,"Resource",OBJPROP_BMPFILE,"\\Experts\\Tester EA.ex4::Resource"))Print("Resource is not connected!"); else Print("Resource connected!"); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTick() { Char_Uint u; uint width,height; //----------------------------- if(!ResourceReadImage("\\Experts\\Tester EA.ex4::Resource",u.Uint,width,height))Print("Failed to read resource! ",GetLastError()); //----------------------------- double bid = u.Double; //----------------------------- Print(DoubleToString(bid,5)); } //+------------------------------------------------------------------+ 思うように動かない。 Vasiliy Sokolov 2018.12.20 15:29 #946 念のため、私のソースをご紹介しておきますので、チェックしてみてください。 ファイル: Tester_EA.mq4 3 kb Tester_EA_Get.mq4 2 kb Реter Konow 2018.12.20 15:40 #947 Vasiliy Sokolov: 念のため、私のソースをご紹介しておきますので、ご確認ください。いいえ、同じです。EAの名前にスペースが入っているのが原因かも?スペースなしでダウンロードしたはずなのに、スペースが出てしまった。やり直します。 Vasiliy Sokolov 2018.12.20 15:43 #948 Реter Konow:いいえ、同じです。EAの名前にスペースが入っているのが原因かも?スペースなしでダウンロードしたはずなのに、スペースが出てしまった。やり直します。試してみてください。スペースの使用は非常に好ましくありません。この悪い癖を治しましょう。 Реter Konow 2018.12.20 15:47 #949 書いています。 2018.12.20 17:46:26.798 Tester_EA_2 EURCHF,H1: 0.00000 2018.12.20 17:46:34.801 Tester_EA_2 EURCHF,H1: Failed to read resource! 4100 4100 -err_some_file_error Реter Konow 2018.12.20 15:55 #950 了解です。ファイル読み込みエラー - ダッシュを付け忘れただけです。追加して、結果的に戻ってきました。 2018.12.20 17:55:24.590 Tester_EA_2 EURCHF,H1: 9223464270575144355.75808 1...888990919293949596979899100101102...184 新しいコメント 取引の機会を逃しています。 無料取引アプリ 8千を超えるシグナルをコピー 金融ニュースで金融マーケットを探索 新規登録 ログイン スペースを含まないラテン文字 このメールにパスワードが送信されます エラーが発生しました Googleでログイン WebサイトポリシーおよびMQL5.COM利用規約に同意します。 新規登録 MQL5.com WebサイトへのログインにCookieの使用を許可します。 ログインするには、ブラウザで必要な設定を有効にしてください。 ログイン/パスワードをお忘れですか? Googleでログイン
労働組合もすでに整理してある。
最後まで把握できていない。
それはおかしい。
そうですね。
そして、コードの不注意は?受信者と送信者で異なるChar_Uint構造体を持っている!
最後まで正確に把握できていない。
それはおかしい。
そうですね。
そして、コードの不注意は?受信者と送信者で異なるChar_Uint構造を持っているのですね!
ありがとう、ヴァシリー。必要であることを知りませんでした。構造体が同じであるバリエーションも試しましたが。
とにかく、出力結果が私の望むものではありません。以下はそのコードです。
そして、受け手。
結果
でも、少なくとも変わりはしない。値は一定です。(ただし、Bid値の変更に伴って変更されるはずです)。
でも、少なくとも変わりはしない。値は一定です。(ただし、Bid値の変更に伴い、変更されるはずです)。
私のコンピュータでのあなたの例は正しく動作しているので、これは非常に奇妙です。エキスパートを作るために両方試して、2つのチャートに簡単に配置します。
私のコンピュータでのあなたの例は正しく動作しているので、これは非常に奇妙です。エキスパートを作るのと、2つのチャートだけを配置するのと、両方試してみてください。
オッケーです。
以下は、2つ目のグラフの2つ目のEAのコードです。結果は同じ...
思うように動かない。
念のため、私のソースをご紹介しておきますので、ご確認ください。
いいえ、同じです。EAの名前にスペースが入っているのが原因かも?スペースなしでダウンロードしたはずなのに、スペースが出てしまった。やり直します。
いいえ、同じです。EAの名前にスペースが入っているのが原因かも?スペースなしでダウンロードしたはずなのに、スペースが出てしまった。やり直します。
試してみてください。スペースの使用は非常に好ましくありません。この悪い癖を治しましょう。
書いています。
4100 -err_some_file_error
了解です。ファイル読み込みエラー - ダッシュを付け忘れただけです。追加して、結果的に戻ってきました。