Finally i have made an Expert Advisor, based on time for you. Test it with strategy tester, and see how it works:) Improve it if you want to. And use it f.
![Ontimer Ontimer](/uploads/1/2/4/9/124939461/105175207.jpg)
Join GitHub today
GitHub is certainly house to over 36 million programmers working jointly to sponsor and evaluate code, deal with tasks, and construct software jointly.
Indication upCome across documentCopy route
breakermindRevise CopierMaster.mq4191758dFebruary 19, 2016
1factor
//+-+ |
// BreakermindMT4Get good at.mq4 |
// Copyright 2011, Breakermind.com |
// https://breakermind.com |
//+-+ |
#property or homecopyright'© 2011, Breakermind.com' |
#propertylink'https://breakermind.com' |
insightboolBegin=real; |
insightintTimer=5000; |
inputint2nd=6000000; |
insightboolssl=false; |
inputthreadurl='localhost'; |
intRefresh=Timer; |
chainapiurl; |
voidOnInit |
if(Refreshlt;3000)Refresh=3000; |
EventSetMillisecondTimer(Refresh); |
// api url http or https(ssl) |
if(ssl) |
apiurl='https://'+url+'/fx/list.php'; |
if(!ssl) |
apiurl='http://'+url+'/fx/list.php'; |
//finish |
voidOnTimer(void) |
if(!Start)Print('On EA very first!');return; |
charwrite-up; |
charresult; |
threadheaders; |
inters; |
linesend=''; |
stringjobs=''; |
chainhistoryall=''; |
intpurchases=OrdersTotal; |
for(inti=0;ilt;purchases;we) |
if(OrderSelect(i,SELECTBYPOS,MODETRADES)) |
if(OrderTypeOPSELLamp;amplifier;OrderOpenTimegt; (TimeCurrent-2nd) ) |
Print out('SELL'); |
opportunities=positions+OrderOpenTime+';'+OrderTicket+';'+OrderOpenPrice+';'+OrderSymbol+';'+OrderLots+';'+'0'+';'+OrderStopLoss+';'+OrderTakeProfit+';'+OrderProfit+';'+AccountNumber+''; |
if(OrderTypeOPBUYamplifier;amplifier;OrderOpenTimegt; (TimeCurrent-Second) ) |
Print out('BUY'); |
jobs=opportunities+OrderOpenTime+';'+OrderTicket+';'+OrderOpenPrice+';'+OrderSymbol+';'+OrderLots+';'+'1'+';'+OrderStopLoss+';'+OrderTakeProfit+';'+OrderProfit+';'+AccountNumber+''; |
else |
Printing('Orders error',GetLastError); |
break up; |
intii,hTotal; |
hTotal=OrdersHistoryTotal; |
for(ii=0;iilt;hTotal;ii) |
if(OrderSelect(ii,SELECTBYPOS,MODEHISTORY)false) |
Print out('History Error',GetLastError); |
crack; |
if(OrderTypeOPSELLOrderTypeOPBUY) |
historyall=historyall+OrderOpenTime+';'+OrderTicket+';'+OrderOpenPrice+';'+OrderSymbol+';'+OrderLots+';'+OrderType+';'+OrderStopLoss+';'+OrderTakeProfit+';'+OrderCloseTime+';'+OrderClosePrice+';'+OrderProfit+';'+AccountNumber+''; |
send= |
'amp;accountid='+AccountNumber+ |
'amplifier;time='+TimeCurrent+ |
'amp;roles='+roles+ |
'amp;historyall='+historyall+ |
'amp;balance='+AccountBalance+ |
'amplifier;equity='+AccountEquity+'amp;finish=0'; |
Print out('Get better at send:',send); |
StringToCharArray(send,blog post); |
ResetLastError; |
res=WebRequest('POST',apiurl,NULL,NULL,50,blog post,ArraySize(blog post),outcome,headers); |
if(res-1) |
Print out('Error code =',GetLastError); |
Print out('Include address ''+apiurl+'' in Expert Advisors tabs of the Options window','Error',MBICONINFORMATION); |
else |
Print('Machine reaction:'+CharArrayToString(outcome,0)); |
//end |
//+-+ |
/. |
lt;?php |
// save to document all information |
if($SERVER'REMOTEADDR' != '::1')echo 'Mistake001'; |
echo fileputcontents('pos/'.day('Y-m-d-H-m',time).'.txt', serialize($Posting)); |
?gt; |
./ |
Duplicate ranges Copy permalink
How can I get present milliseconds from MQL4 using an Professional Consultant.
i actually.at the.: in Java we can get current milliseconds making use of
Stanislav Kralinprogram.currenttimemillis
8,16144 money badges2020 silver precious metal badges4343 bronze badges
Nitin VavdiyaNitin Vavdiya
3 Answers
This MT4 'Obtain millisecond' issue has been recently around for age range. This is certainly a crack I made to resolve this problem.
Joseph LeeJoseph Lee
Can have relative master of science or actually us:
End up being cautious as both are essential contraindications, but one with regard to the program begin, the other with regard to the MQL4 code-execution device begin.
The
GetTickCount
function results the quantity of milliseconds that elapsedsince the system begin.uint GetTickCount;
Kitchen counter is limited by the limitations of the system timer. Period is kept as an unsigned integer, therefore it's overfilled every 49.7 days if a computer functions uninterruptedly.
The
GetMicrosecondCount
function profits the number of microseconds that have elapsedsince the start of MQL plan.ulong GetMicrosecondCount;
Can have absolute master of science or actually us, with const(!) ABSOLUTE Mistake,
that will exhibitneither any move, nor jitter in specific testing of time.
Isn'capital t this great for FOREX domain name, where milliseconds are'complete of activities'and microseconds ( nanoseconds in recent professional-grade designs ) issue ?!
+ This alternative operates in all Script Expert Advisor Custom made Sign
user3666197user3666197
something like this:
ulong time = GetTickCount; // functionality; period = GetTickCount-time;
2,92022 yellow metal badges88 silver badges1616 bronze badges