My EA doesn't work on VPS

 

Hi everybody, 


1.5 years coding EAs and first time open up a thread so believe me I did my homework, and sorry if it's a basic error but i'm stuck. 


So I got an EA, she is calling 3 custom indicator (it's because my EA is multisymbol, i use the code below)

Articles

The Implementation of a Multi-currency Mode in MetaTrader 5

Konstantin Gruzdev, 2011.02.18 17:58

For a long time multi-currency analysis and multi-currency trading has been of interest to people. The opportunity to implement a full fledged multi-currency regime became possible only with the public release of MetaTrader 5 and the MQL5 programming language. In this article we propose a way to analyze and process all incoming ticks for several symbols. As an illustration, let's consider a multi-currency RSI indicator of the USDx dollar index.


And every thing is working fine when i'm on my computer.




But once i try to push that on the mql VPS, the spy indicator don't want to and I don't know why...



well seams like even the error code of mql don't want me to figure that out : 



I do not have any clue of why all that happenning but if you have an idea I would be verry greatfull. 

I you don't I wish you a good day anyway.

 
Connect the indicator as a resource (#resource)
 
Sacha Olivier Isabe Berthelon: But once i try to push that on the mql VPS, the spy indicator don't want to and I don't know why...

You put the EA on the VPS. You didn't put the indicators. "Indicator cannot be created."

The indicator isn't part of your product. Therefor, the product can't use it except when running on your machine. Why does this surprise you when you try to use the cloud or Market Validation?

Just embed the other indicator(s) inside your indicator/EA. Add the CI(s) to your code as a resource.
          Use the publicly released code - MQL5 programming forum (2017.02.20)
          Resources - MQL4 Reference

Be aware that using resources is 40x times slower than using CIs directly.
          A custom indicator as a resource - MQL4 programming forum (2019.11.26)

Also make use there are no spaces in the path.
          Getting error 4802 when loading custom indicator that loads another custom indicator with iCustom - Technical Indicators - MQL5 programming forum. (2020.07.21)

 

First, thank you verry much for your quick response,


In did that makes sense that if it dl my expert and then lauch it on cloud without my custom indicator in library, 


I've also read your post and at the end they said it 40 times longer on mql4 but no info on mql5 have you got some since ? 


I'll try the #ressource en keep you posted. 


Thanks again :)

 

and yes it's not the last post you put (sorry i didn't put the  code in)


there it is 


      if(iCustom(arrayFullNameAsset[0],PERIOD_M1,"SPY.ex5",ChartID(),0)==INVALID_HANDLE) 
      { Print("Error in setting of spy on "+arrayFullNameAsset[0]); return(true);}
      if(iCustom(arrayFullNameAsset[1],PERIOD_M1,"SPY.ex5",ChartID(),1)==INVALID_HANDLE) 
      { Print("Error in setting of spy on "+arrayFullNameAsset[1]); return(true);}
      if(iCustom(arrayFullNameAsset[2],PERIOD_M1,"SPY.ex5",ChartID(),2)==INVALID_HANDLE) 
      { Print("Error in setting of spy on "+arrayFullNameAsset[2]); return(true);}
 

So i've added in ressources but seems to not work either



same error, 


here the new code 


#property copyright "SA society"
#property link      ""
#property version   "1.00"
#property script_show_inputs

#resource "\\Indicators\\SPY.ex5"
#include <SachaFunctions.mqh>

input int magicNumber;
input string AssetA1   = "EUR";
input string AssetA2   = "USD";
input string PostFixeA = "+";
input string AssetB1   = "EUR";
input string AssetB2   = "GBP";
input string PostFixeB = "+";
input string AssetC1   = "GBP";
input string AssetC2   = "USD";
input string PostfixeC = "+";


if(iCustom(arrayFullNameAsset[0],PERIOD_M1,"::indicators\\SPY.ex5",ChartID(),0)==INVALID_HANDLE) 
      { Print("Error in setting of spy on "+arrayFullNameAsset[0]); return(true);}
      if(iCustom(arrayFullNameAsset[1],PERIOD_M1,"::indicators\\SPY.ex5",ChartID(),1)==INVALID_HANDLE) 
      { Print("Error in setting of spy on "+arrayFullNameAsset[1]); return(true);}
      if(iCustom(arrayFullNameAsset[2],PERIOD_M1,"::indicators\\SPY.ex5",ChartID(),2)==INVALID_HANDLE) 
      { Print("Error in setting of spy on "+arrayFullNameAsset[2]); return(true);}


if you find something not right i'll all ears 

 

Ok, 


I've put one \ that should'nt be there, now it's seem to work : 




Somehow i'm wondering if that means that my EA have no right to trade on my PC or if it's forbiden on the VPS too ? 



Sorry i'm a noob using metatrader VPS more used to third party web sites

 

Autotrading is disabled in your home Metatrader after you synchronized the chart(s) and EA(s) with MQL5 VPS (because your EA will be traded on MQL5 VPS, and your home Metatrader has nothing to do with it since then).

----------------

More details (about how to use EA in MQL5 VPS):

My EA don't work on VPS
My EA don't work on VPS
  • 2021.08.26
  • www.mql5.com
Hi everybody, 1.5 years coding EAs and first time open up a thread so believe me I did my homework, and sorry if it's a basic error but i'm stuck...
 

Thank you now I know this is normal but... 


I'm comming back again ^^ 


In did, I've  add add a recource and acces to my custom indicator.


Still it don't work..


I start to believe than it's just not possible to call custom indicator that will operate on another asset that on the one i've put the EA on. anyway I will take another VPS if you guys don't have any other idea 


working on my computer :


not on the cloud : 


my code : 


ressource init :


#property copyright "Sacha"
#property link      ""
#property version   "1.00"
#property script_show_inputs

#resource "\\Indicators\\SPY.ex5"
#include <SachaFunctions.mqh>

input int magicNumber;
input string AssetA1   = "EUR";
input string AssetA2   = "USD";
input string PostFixeA = "+";
input string AssetB1   = "EUR";
input string AssetB2   = "GBP";
input string PostFixeB = "+";
input string AssetC1   = "GBP";
input string AssetC2   = "USD";
input string PostfixeC = "+";

input double amountToWinToOpen = 5;
input double singleCommission=2.5;
input double baseVolume = 1;
input int slippageInPoints=0;


the init of the custom indicator : 


      //SPY init 
      
      if(iCustom(arrayFullNameAsset[0],PERIOD_M1,"::indicators\\SPY.ex5",ChartID(),0)==INVALID_HANDLE) 
      { Print("Error in setting of spy on "+arrayFullNameAsset[0]); return(true);}
      if(iCustom(arrayFullNameAsset[1],PERIOD_M1,"::indicators\\SPY.ex5",ChartID(),1)==INVALID_HANDLE) 
      { Print("Error in setting of spy on "+arrayFullNameAsset[1]); return(true);}
      if(iCustom(arrayFullNameAsset[2],PERIOD_M1,"::indicators\\SPY.ex5",ChartID(),2)==INVALID_HANDLE) 
      { Print("Error in setting of spy on "+arrayFullNameAsset[2]); return(true);}
      
      Alert("Triangular Arbitrage V2 succefully lauched");



If u want the full code ask and I will send, 


Thank you for all you have already did :) 

 

Ok !!!!!!


Got it ! this is what I thought ! 


MQL VPS select in the VPS market watch only symbol who have an expert/indicator attached to it, thus because i'm calling the "SPY indicator" from 1 chart to 3 differents symbol thoses symbols are not in the VPS market watch so it can't create an indicator on it. 


So solution 1 -> I put MA on the chart of the 2 symbol that are not on the VPS market watch so they will be inside and my SPY will be able to initialize. 

The problem here is than It's going to cost me 2 additionnal indicator in addition of the EA (1) plus the psy (3) wich mean than every EA I lauch will cost me 6 Spot.


Considering I have the right of using 32 spot in my MQL VPS, 


If everything run smoothly 4 spot by EA (3 spy + EA) = 32/4 = 5.33 = 8 EA max by VPS

With solution 1 we use 6 spot (3spy + EA + 2MA)       = 32/6 = 5.33 = 5 EA max by VPS


If anyone have an idea so I can be able to put 8 EA by VPS is welcome :) 


And as alway I wish you the best !

 
Sacha Olivier Isabe Berthelon #:
...

In did, I've  add add a recource and acces to my custom indicator.

...
You can attach this custom indicator to the chart (to the same chart with the EA(s), or/and to empty chart(s) for example).
Some people did it and it helped them (I could not find the thread about it now sorry).
Reason: