Download MetaTrader 5

Why my EA did work on PC but not working on Meta Server/Hosting

To add comments, please log in or register
Rizal Dwi Satria
333
Rizal Dwi Satria 2016.06.13 23:35 

why? how come?

the cpu % also seems 0%

what are causes these?

i test another EA , same time migration, the other EA worked

HELP

Files:
cpu.png 12 kb
Rizal Dwi Satria
333
Rizal Dwi Satria 2016.06.14 15:41  
anyone know why?
Aleksey Pak
3583
Aleksey Pak 2016.06.14 15:54  
Hello provide logs from hosting terminal. Thank you.
Rizal Dwi Satria
333
Rizal Dwi Satria 2016.06.15 02:30  
Aleksey Pak:
Hello provide logs from hosting terminal. Thank you.

there was no error


too bad i was frustated and now wrong click to cancel hosting , after 2 days using but buying for 1 month. So sad.

and also the too bad is cant debug "Print" on hosting server? all working on my pc

this code was at front the core code to buy/sell

void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {  
   //Print((int)MarketInfo(NULL,MODE_SPREAD));
   //Print(IsTradeAllowed(),(int)MarketInfo(NULL,MODE_SPREAD)>10,AccountNumber(),DayOfWeek()>0,DayOfWeek()<6,DayOfYear()!=today);
   if(IsTradeAllowed()==false){return;}
   //Print((int)MarketInfo(NULL,MODE_SPREAD));
   if((int)MarketInfo(NULL,MODE_SPREAD)>10){return;};
   if(AccountNumber()+3!=2100361){return;}   
   if((DayOfWeek()>0)&&(DayOfWeek()<6)){
   //Print(BuyW,BuyD,SellW,SellD,"TOP");
   if(DayOfYear()!=today){
      today=DayOfYear();
      detect();      
   }   
   string str,str3;
   //bool res;
   str3=IntegerToString(DayOfYear());
   if(StringLen(str3)==1){str3="00"+str3;}
   if(StringLen(str3)==2){str3="0"+str3;}
   //Print("test");
   //return;
   if (BuyW&&(LastWeekBuy<DayOfYear())){ 
      //Print(BuyW,BuyD,SellW,SellD,"W1B");
      RefreshRates();
      if(TimeDay(iTime(NULL,PERIOD_D1,0))!=TimeDay(TimeCurrent())){return;}
      if(
(iClose(NULL,PERIOD_W1,0)>iHigh(NULL,PERIOD_W1,1))&&

this one is part of the OrderHistoryTotal

if((7-TimeDayOfWeek(OrderOpenTime())+TimeDayOfYear(OrderOpenTime()))>(DayOfYear())){        

Do we have bug issue that some command/code didnt work on Meta Hosting/Server???

Aleksey Pak
3583
Aleksey Pak 2016.06.15 15:16  
Rizal Dwi Satria:

too bad i was frustated and now wrong click to cancel hosting , after 2 days using but buying for 1 month. So sad.


Please write a ticket to the ServiceDesk.

and also the too bad is cant debug "Print" on hosting server? all working on my pc

this code was at front the core code to buy/sell

this one is part of the OrderHistoryTotal

Do we have bug issue that some command/code didnt work on Meta Hosting/Server???

Print worked without any issues in the hosting. You should select experts log in the log viewer.


Rizal Dwi Satria
333
Rizal Dwi Satria 2016.06.18 17:12  
Aleksey Pak:

Please write a ticket to the ServiceDesk.

Print worked without any issues in the hosting. You should select experts log in the log viewer.


i was already checked it . but i didnt see any print for debugging. well cant do anything for this moment, waiting servicedesk respond.
Daniel Stein
26072
Daniel Stein 2016.06.19 19:29  

Cheers Rizal,

just one question: Why do you use OnChartEvent?

According to the definition this function reacts only on Events that happen on a chart like a keystroke or mouseclick.

But none of these events will ever happen on your virtual vps because there is no chart and no event.

 

I'm pretty sure it will work if you use OnTick instead.

Event Handling Functions - Functions - Language Basics - MQL4 Reference
Event Handling Functions - Functions - Language Basics - MQL4 Reference
  • docs.mql4.com
Event Handling Functions - Functions - Language Basics - MQL4 Reference
Rizal Dwi Satria
333
Rizal Dwi Satria 2016.06.20 00:11  
Daniel Stein:

Cheers Rizal,

just one question: Why do you use OnChartEvent?

According to the definition this function reacts only on Events that happen on a chart like a keystroke or mouseclick.

But none of these events will ever happen on your virtual vps because there is no chart and no event.

 

I'm pretty sure it will work if you use OnTick instead.

OnChartEvent is on a new bar created you can use it on chart with 1M timeframe to reduce cpu cost than using on tick.
Daniel Stein
26072
Daniel Stein 2016.06.20 07:23  
Rizal Dwi Satria:
OnChartEvent is on a new bar created you can use it on chart with 1M timeframe to reduce cpu cost than using on tick.

Wrong! 

Read the MQL4 documentation: https://docs.mql4.com/basis/function/events

Event Handling Functions - Functions - Language Basics - MQL4 Reference
Event Handling Functions - Functions - Language Basics - MQL4 Reference
  • docs.mql4.com
Event Handling Functions - Functions - Language Basics - MQL4 Reference
Trinh Dat
37532
Trinh Dat 2016.06.20 15:46  
Rizal Dwi Satria:

there was no error

too bad i was frustated and now wrong click to cancel hosting , after 2 days using but buying for 1 month. So sad.


why cancel  ? you can not get back money.

Rizal Dwi Satria
333
Rizal Dwi Satria 2016.06.20 16:33  
Daniel Stein:

Wrong! 

Read the MQL4 documentation: https://docs.mql4.com/basis/function/events

Wrong~

Watch this pic. It worked on other VPS PC. If want more tricky go add moving average on the chart manually. If using OnTick cause 20%-50% cpu usage, so i use OnChart only cost 1%. Good for me who still using e5400 procie. I think is this event "CHARTEVENT_OBJECT_CREATE". In past we use newBar[array]. :D. But probably you also right which EA act different for virtual meta hosting and PC/VPS PC because no chart, but why does they said to be migrate EA,Chart,Indicator, just wait until my Virtual Webzilla back so i can test it. Or probably caused by putting EA on M1 but analyze on W1.


Files:
123.png 93 kb
12
To add comments, please log in or register