[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 255

 
NEKSUS_ >> :

Good afternoon gentlemen, again please help with the object elimination script.

The script removes several objects by name, but on launching it pops up a hundred errors (more precisely, the same one, but many times) help plz.


I take it this fancy code is designed to delete all objects with numbers in their names from the chart? Well, then put else before all of the ifs, except the first one. Otherwise your index x already falls through into the negative area at the first iteration.

 
NEKSUS_ >> :

Good afternoon gentlemen, again please help with the object elimination script.

Script kills some objects by name, but on start it pops up a good hundred errors (more precisely, the same one, but many times) help ps.


replace this loop for (int x = ObjectsTotal(); x>0 ; x--) (only correct for bugs, like more or equal and take 1 from the number of objects) and remove all the "x--;" in the ifs

 
dmmikl86 >> :

help me colour the indicator, I want it to be green if the value goes up, red if it goes down

here is the code:


here's one to help

https://www.mql5.com/ru/articles/1451

Implementation of tri-color indicators and some features to make writing indicators as simple as possible

 
alsu >> :

I understand that this intricate code is designed to remove from the chart all objects with a digit in their name? Well, then put before all if, except the first, and else as well. Because at the first iteration your index x already falls in the negative area.


It won't fail, it's very hard to find an object with a negative index, or rather it might fail, but by a maximum of one.
 

Dear Professionals, please help. The idea is that the EA should create an order and then create the same order again if that order fails. But it does not?

//--------------------------------------------------------------- 0 ----------------

int start() // Special function start

{

int H=100; // Set time - second

int Dist=10; // Set TP and SL

double Lot=1; //set lot

//--------------------------------------------------------------- 1 ----------------

double i=0.001;

double Cena=NormalizeDouble(Ask,3); // normalize price

double Price=NormalizeDouble(Cena+i,5); // Find price

double TP=Price+Dist*Point; // Find TP

double SL=Price-Dist*Point; //Find SL

int x=1; // First condition

int y=1; // Second condition

//--------------------------------------------------------------- 2 ----------------

for (int pos=1; pos<=OrdersTotal(); pos++) // loop through all orders

{ if (OrderSelect(pos-1,SELECT_BY_POS)==true) // highlight an order

{ if (OrderTakeProfit()==TP)

{ Alert("triggered x");

x=2;

break;

}

}

else Print("Error ", GetLastError(), " when selects order number ", pos);

}

//--------------------------------------------------------------- 3 ----------------

for (pos=1; pos<=OrdersTotal(); pos++) // loop through all orders

{ if (OrderSelect(pos-1,SELECT_BY_POS)==true) // mark an order

{ if (OrderOpenPrice()==Price)

{ Alert("triggered y");

y=2;

break;

}

}

else Print("Error ", GetLastError(), " when selects order number ", pos);

}

//--------------------------------------------------------------- 4 ----------------

if (x==2&y==2)

{ Alert("This order already exists!!!");}

else { Alert("order has been sent",Symbol()," BUYSTOP ", Price," Pending...");

OrderSend(Symbol(), OP_BUYSTOP, Lot, Price, 0, SL, TP);

}

Sleep(H*60); //Wait 60 seconds

RefreshRates();

//--------------------------------------------------------------- 5 -------------------

Alert ("The script has finished working -----------------------------");

return; // Exitstart()

}

 

I have installed MT4 (from forex4you), I'm testing strategies, but my M1 quotes are only from 2.09.2009, I can't download them through the service-archive of quotes,

Can you tell me where I can download the quotes archive at least for 2009? Another thing, when I set the date in the strategy tester the quotes are not downloaded automatically.

 
albon >> :

I have installed MT4 (from forex4you), I'm testing strategies, but the quotes from M1 I have only from 2.09.2009, I can't load them through the service-archive of quotes,

Can you tell me where I can download the quotes archive at least for 2009? When I set the date in the strategy tester the quotes are not downloaded automatically.

Try to install the MT4 by another broker. (i.e. different MT4).

 

Dear Professionals, please help. The idea is that the EA should create an order and create the same order again if this order fails. But this does not happen?

It creates orders all the time - endlessly.


 
VII >> :

Dear Professionals, please help. The idea is that the EA should create an order and then create the same order again if that order fails. But it does not?

//--------------------------------------------------------------- 0 ----------------


double Cena=NormalizeDouble(Ask,3); //Normalize price

It will not be able to create the same order, because Ask is constantly changing on every tick. And all other parameters and their comparisons in conditions are calculated from this variable.

 
VII >> :

Dear Professionals, please help. The idea is that the EA should create an order and then create the same order again if that order fails. But this does not happen?


We have two ways for the EA/script to open exactly the same order as the one we have set. First, we set the order and write all of its parameters in the variables which will store them. If there is no order, we will switch to the standby mode. As soon as we reach a condition where an order with these parameters can be set, we open an order.

Secondly. Once the order has disappeared from the market, go through the history and find the most recent order. We record its parameters and switch on the standby mode as we did in the first case.

What I want to say is this. If you build the logic of the programme in the way you've described and I've explained here, all orders will wait for the same horizontal level. Do you need it?

Reason: