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

 
Ant_TL:
When the EA parameters are changed, the objects/variables are not re-initialised? That is, they were initialised at startup, but when parameters are changed, only OnDeinit is called, then OnInit and nothing else happens?

you me?
 
Is it possible from the window where the EA is located to graphically display the opening/closing of an order with the OrderSend command in exactly the same way as in the main window?
 
366366:


This is the formula for calculation of lots for EURUSD with a leverage of 1:500.

The original formula was different, but also for 1:500 leverage.

Changed to my own: double lots = (AccountBalance()*0.0025*Bid);

The problem remained, it also opens 2 lots.


I have shown you where the legs (error) are growing from. The lot definition is totally wrong, there is no normalisation (First time I see lot calculation from pair price). Of course, if nothing is corrected, the problem will remain.
 

what is the input to the Alligator indicator for example, what is the price ?

in real and in test mode

 

Good afternoon to all forum members !

Another question from a beginner coder:

I have put the iClose() function in the Expert Advisor template with Print -

#property copyright "Copyright 2012, 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()

{

//---

Print("Zakr",iClose(Symbol(),1440,0));

Print("Otkr",iOpen(Symbol(),1440,0));

Print("MAX",iHigh(Symbol(),1440,0));

return;

}

Since timeframe is set to 1440 (I just copied it at random from the textbook), the result must be the same for one day. But when testing the Print operator in the terminal, it produced about two dozen results per day.

What do I need to change or add (I think there is nothing to delete and we actually have 2 rows) to have 1 parameter for 1 day (at least closing price).

Thanks in advance to all who answered ("I'm not a programmer, I'm still just learning").

 
Scalp2014:

Good afternoon to all forum members !

Another question from a beginner coder:

I have put the iClose() function in the EA template with Print to output the result.

Close price).

I am very grateful in advance to all who replied ("I'm not a programmer, I'm just learning").

if (iClose(...)==iOpen(...)), ха или просто iOpen
iClose - current BID
 

Good afternoon!

Folks please help push a thought!

How to make the script find a certain bar on the chart? For example, I drew a vertical line on bar #n, threw the script and it calculates parameters on this bar #n. So, I can't make the script look for this bar #n. Help!

 
Roger:

I showed you where the legs (error) are growing from. The lot definition is totally wrong, there is no normalization (First time I see lot calculation from pair price). Of course, if you don't fix anything, the problem will remain.


The idea of the formula is to open the maximal lot, depending on the deposit. It works perfectly in the tester.

The original had a different formula, also with a leverage of 1:500, but there was still a problem.

Unfortunately, I deleted this formula and forgot to save it.

Even if I set a fixed lot, the error is not eliminated.

Plus I used this formula in other programs. everything worked fine.

 
MauzerVII:

Good afternoon!

Folks please help push a thought!

How to make the script find a certain bar on the chart? For example, I drew a vertical line on bar #n, threw the script and it calculates parameters on this bar #n. So, I can't make the script look for this bar #n. Help!


Yes! I just wrote the question and immediately figured out how to do it. Thanks to the forum)))))
 

Hello, Could you please tell me how to correctly prescribe the function to delete the pending orders? For example, I have an EA that places pending orders at the moment a new daily bar appears. It should delete the pending orders one day later and set new ones. The problem is that when testing in the MT4 tester, all orders are not always closed.

Reason: