Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1231

 
Madmas:

Help plz. Why during testing it gives error - "" 2020.08.13 13:09:11.393 2018.08.01 00:00:123456 GBPUSD,M30: array out of range in '123456.mq4' (59,13)"" ????

for iBufUP you need to either set the dimension immediately, or you can set it via ArrayResize in OnInit

in your code had neither, so OutOfRange

 
Hello! Please advise how to correctly determine the collateral amount for a stock position. Here in this thread: https://www.mql5.com/ru/forum/348957
Помогите с расчетом объема
Помогите с расчетом объема
  • 2020.08.14
  • www.mql5.com
Биржевой трейдинг: Помогите с расчетом объема
 

Please advise, after loading the quote archive, I got a gap in the quotes from 31 July to 13 August 2020 for 1M and 5M. What is wrong?

Skipping quotes

 
Hi, I can't figure out what the problem is.
//+------------------------------------------------------------------+
//|                                                       Oduvan.mq4 |
//|                        Copyright 2019, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
bool BuyOne(string symbol=NULL,double price =0,double volume =0,ulong magic=0)
 {
   double sl=0,tp=0;
   int devi=4;
   string  comment;
   string sym= Symbol();
 if(!OrderSend(sym,OP_BUY,volume,price,devi,sl,tp,comment,(int)magic,0,clrBlue))
     {
      Print("Ошибка: ",(string)GetLastError());
      return false;
     }
 }

Outputs

'}' - not all control paths return a value Oduvan.mq4 48 2


 
Galim_V:
Good afternoon, I can't figure out what the problem is.

Outputs

'}' - not all control paths return a value Oduvan.mq4 48 2


bool BuyOne(string symbol=NULL,double price =0,double volume =0,ulong magic=0)
 {
   double sl=0,tp=0;
   int devi=4;
   string  comment;
   string sym= Symbol();
 if(!OrderSend(sym,OP_BUY,volume,price,devi,sl,tp,comment,(int)magic,0,clrBlue))
     {
      Print("Ошибка: ",(string)GetLastError());
      return false;
     }
     return true;
 }

The return should be from the body of the function and you had it from the if function. that's why it fails.

 
Valeriy Yastremskiy:

The return should be from the body of the function and you had it from the if function. that's why it's fighting.

Thank you!

 

Good afternoon. A question about the organisation/structure of data handling.


There are many terminals, vpc, similar. Expert Advisors and indicators via mysql libraries report to database and receive commands from the same place. The Expert Advisor has a basic structure: a pair class (like EURUSD) where ticks and events are received and from where the data are passed to instances of independent instances of the matrix class (a child independent unit in the pair including positions, orders, mechanics of working, etc.). In essence, the matrix class was created to store piles of data (arrays of structures with positions and profit calculations, etc.). To access the data, every tick each matrix drops a sample of data into the database. Lots of queries. Lots and lots of workload. Q&A. Advise specific examples on how to organise a centralised data management and structuring system. How do you organise data and access to it? Do you use complex structures and base class or do you create instances of subclasses using CArrayObj? I understand the question is general. My aim is to find optimal chain for structure building with minimal time and possibility to extend it (new subclasses in matrix with instructions are added regularly). Do I use python to read directly from general program and put it into a database in between, or is a database already the best option? I don't have enough experience, and the system is big). And to store inside "storage" a stack of structures with positions and orders, dozens of variables + respond to calls like onTrade onTradeTransaction onTick from the big brother.


P.S.: And is there any way to run EA and indicators somehow more compact? without terminals via powershell cmd...

P.P.S: To the question above - one terminal = all threads, but one EA = 1 core? i.e. is it impossible to select-parallelize the work of bots yourself? choose in the code whether this bot is running in priority or waiting for free threads. There are probably loopholes for CPU shaping...

P.P.P.S.: I understand that in search of a lot of possibilities, but after a year of re-reading a tenth of it, I haven't found the above. Understand to forgive. If anything I won't repeat myself.

Thank you for your help

 
I first connected the signal on my home computer, then I bought a third party VPS and connected it there, the account picked up, but the signal did not appear there. Is the signal tied directly to the terminal ? how to disconnect it from the first one ? i couldn't find a solution on the forum. can you tell me ?

if you click on the "unsubscribe" button will it disconnect from the terminal or the signal ?

UPD related problem, not authorizing in mql5 from my VPS ? what can be the reason ?

upd upd tried to check new qql5 account, it says "no authorization possible from datacenter", what is it ? is there some kind of blockage somewhere ?

 

Hello,

how do you search for advisers here so you don't have to order? maybe this bike has already been made by someone else.

 
Askold4:

Hello,

how do you search for EAs here so you don't have to order one? maybe this bike has already been made by someone else.

Source code library

MQL5 Code Base
MQL5 Code Base
  • www.mql5.com
Торговля по двум индикаторам iTriX (Triple Exponential Average, TRIX). Каждый индикатор работает на своём таймфрейме. Между позициями задаётся минимальный шаг. В начале дня открывается позиция наугад. Направление второй...
Reason: