こんばんは。キリンです。
IsStopped()関数を調べていて気づいたことは、start()関数はEA除去時に2.5秒間稼働し続けることです。
あれ?でも、deinit()も2.5秒間だったような・・・
start()の残処理で2.5秒間使ってしまったら処理がdeinit()は起動するのでしょうか。
分からないので、実際にやってみました。
こんなプログラムを作って、実際に検証。
//+------------------------------------------------------------------+//| test.mq4 |//| Copyright Kirin 2010, MetaQuotes Software Corp. |//| http://ameblo.jp/ftlabo-kirin/ |//+------------------------------------------------------------------+#property copyright "Copyright(C)2010, ForexTradingLaboratory"#property link "http://www.ftlabo.com/"//#property show_inputs
#include <common_functions.mqh>
//+------------------------------------------------------------------+//| script program start function |//+------------------------------------------------------------------+
int init(){
return(0);}
int deinit(){//---- int start = GetTickCount(); int now; int last; while(true){ now = GetTickCount();
if(now-last>100){ log("Action by end "+(start - now)+" millisecounds"); last = now; } }//---- return(0);}
int start() {//---- int start; int now; int last; bool isStopped = false; bool first = true; while(true){ isStopped = IsStopped(); if(isStopped){ if(first){ start = GetTickCount(); first=false; } now = GetTickCount();
if(now-last>100){ log("Action by start "+(start - now)+" millisecounds"); last = now; } } }
return(0); }//+------------------------------------------------------------------+
すると、結果がこうなりました。

start()が2.5秒稼働したあと、deinit()でも2.5秒間稼働し続けることが分かりました。
チャンチャン♪
今日もお読み下さりまして、ありがとうございます。


コメント
SECRET: 0
PASS:
とっても渋カッコいい記事です^^
ありがとう。
SECRET: 0
PASS:
>Duck-butt tigerさん
ありがとうございます^^
日本もどられました?