//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 차트의 댓글에 10부터 1까지의 카운트다운을 표시합니다.
for(int i=10; i>0 && !IsStopped(); i--)
{
Comment(StringFormat("Wait %u seconds",i));
Sleep(1000);
}
//--- 스크립트의 목적을 설명하는 "도착" 주석에 텍스트를 작성합니다.
string text="This was a test showing how the Sleep() function works";
string mess="";
for(int i=0; i<(int)text.Length(); i++)
{
mess+=ShortToString(text.GetChar(i));
Sleep(100);
Comment(mess);
}
//--- 안녕...
Sleep(1000);
for(int i=0; i<6; i++)
{
mess=(i % 2 == 0 ? "" : " Bye!");
Comment(mess);
Sleep(300);
}
//--- 차트의 텍스트를 삭제합니다.
Comment("");
}
|