My EA doesn't work on VPS - page 2

 
Sergey Golubev #:
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).

this is what I thought first, then I realized than it was not possible because the indicator send notification to a specific chart, and since the VPS is somehow reloading everything in the cloud the only way to be sure than the indicator will send a message to the good chart is to him to be initilized by the EA (that is on the good chart even in the cloud) 


(some how even with the MA it don't work ;')  )


Tho if anyone have a way to manage the Market watch of the mql VPS I will take it :) 

 

Read the help for iCustom and #resource. Read and compare what is written under the microscope!

 

Just compare these two blocks - there are already a bunch of errors here:

#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);}


iCustom

int  iCustom(
   string           symbol,     // symbol name
   ENUM_TIMEFRAMES  period,     // period
   string           name        // folder/custom_indicator_name
   ...                          // list of indicator input parameters
   );



Documentation on MQL5: Technical Indicators / iCustom
Documentation on MQL5: Technical Indicators / iCustom
  • www.mql5.com
iCustom - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Perhaps you should read the manual, especially the examples.
   How To Ask Questions The Smart Way. (2004
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick/OnCalculate (after the indicator has updated its buffers), you use the handle, shift and count to get the data.
          Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
          Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
          How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 (2020.03.08)
          How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 (2020.07.05)
          How to call indicators in MQL5 - MQL5 Articles (12 March 2010

 

Ok, 


thank for both response 


For the fact than I can get back the desc (int) of the iCustom as other indicator is no concern because I don't have to get data from this indicator. He he's only going to create a custom event on the chart on every ticks so My OnEventChart() is going to be executed. (It's just a way to create a OnTick() functions but for multiple symbol at the same time)


And yes my iCustom is in my OnInit. 


But in did first time I use #ressources so if i've done something bad sorry I don't find but this is verry likely. 


Again my problem is not with the code not running/Compilling. My code work perfect (both indicator and ) of PC, just create some silly error when I push it to the cloud. 


Anyway thank for all the help, really apreciate, 

But I think I will move into a normal VPS. 

You can close the thread

Thank again 

 
Custom Moving Average as a resource: example on post 
How to start with MQL5
How to start with MQL5
  • 2021.08.27
  • www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
Reason: