Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1028

 
Hello.

I can't find the problem in the indicator. The tick chart in one server is shown with 6 digits and in another server with 4 digits. Maybe someone knows why this is the case?


Files:
 
Help with the EA code

I'm just beginning to learn mql4, trying to create an EA using my algorithm. I am interested in this. How to prescribe in the code of the EA, that for each open order or for each newly opened order 2 pending orders are set at a certain distance Step forwards or backwards. Simply, it is clear that if a buy order has just opened and it is the last order, then set a buystop or sellstop. But if i have 5 or 10 open orders at the same time and there are 50 open orders in the market, how do i choose the ones i should place the pending orders on?
 

Hello Experienced forum users, please help.

I have an EA. I am attaching the EA file itself below. I want to insert in its algorithm that the EA uses the formula when calculating the lot: 2% of deposit. Please help me if you can.

Files:
1111.zip  28 kb
 

Out of curiosity and looking for an answer to the question of how best to describe your own functions, I decided to test the speed of a standard function and its bicycle. I took the most trivial one - MathMax. Tried modes of passing parameters by reference, without reference and without parameter passing. Even tried the difference between the description in the include file and the description directly in the native code. In the end the standard function turned out to be 2 times faster than the fastest bike. I didn't understand how that could be. After that I remembered about import and export. Took a look at the results with the compiled bike.

Importing reduced the gap to ~1.35 times.

But there's a problem with exporting: the compiled function is not visible from the outside. The code doesn't compile, an error hangs there:

'Max' - function not defined

Max0' - function not defined

What is the reason for this?

Code of the compiled function:

#property library
#property strict
//+------------------------------------------------------------------+
double Max(const double &v1, const double &v2, const double &fract)export
{
   if(v1 > v2 + fract)
      return(v1);
   else
      return(v2);
}
double Max0(const double &v1, const double &v2)export
{
   if(v1 > v2)
      return(v1);
   else
      return(v2);
}

Called in the indicator code:

V[0] = Max(Open[i], Close[i], Fract);
V[5] = Max0(Open[i], Close[i]);
 
givanchy:

Hello Experienced forum users, please help.

I have an EA. I am attaching the EA file itself below. I want to insert in its algorithm that the EA uses the formula when calculating the lot: 2% of deposit. Please help me if you can.

Order volume = Account balance * Risk * _Point / (Stop order in pips * Pip value)
TV = MarketInfo(_Symbol, MODE_TICKVALUE); // - Эту строку вставить в  On Init
Vol = NormalizeDouble((AccountBalance() * Risk * _Point) / (Stop * TV), 2);// - Эту строку в основном цикле, в месте расчёта параметров ордера
//TV, Vol - double тип,
//Stop, Risk - целочисленный тип,

Risk = the number of percent of the deposit, how much you assign, so it will be.

If from funds, replace AccountBalance() with AccountEquity()

 
SunnYtheDreamer:
Order volume = Account balance * Risk * _Point / (Stop order in pips * Pip value)

Risk = amount of percentage of the deposit; the amount of risk will be equal to the amount assigned to it.

If from funds, replace AccountBalance() with AccountEquity()


Thank you!
 
Who can help to insert a function??? Closing all orders (orders) at a specified time, e.g. 23.00. Pro question for you!!!
 
Iv-off:
Who can help to insert a function??? Closing all orders (orders) at a specified time, e.g. 23.00. A pro question for you!!!
He already answered you where you asked!
 

Hello.

I will be generating signals in the indicator. What functions can I use to send these signals to my Expert Advisor?

 
abeiks:

Hello.

I will be generating signals in the indicator. What functions can I use to send these signals to my Expert Advisor?

iCustom
Reason: