[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 457

 

Good afternoon, all.

Can you describe in the code how to place orders on a work account from the "investor" terminal in parallel.

I would not have to transfer them manually.

The code should not have to be transferred manually.

 
gvi2504 >>:

Добрый день всем.

Вопрос на засыпку.Можно описать в коде, чтобы параллельно выставлялись ордера на рабочем счете, с терминала "инвестор".

Что-бы не переносить в ручную.

Спасибо.


the deal copier is called. there is one on the website in the codebase.
 
fragile86 >>:


if (Bid > MA1 || Bid < MA2) // Проверка прохода диапазона
{
Alert("Цена находится за пределами диапазона.");// Сообщение
}

то если цена находится выше советник то и дело сигналит. а если я делаю так:

it will signal because you have a condition or ( || )

you need to put AND ( && ).

// Проверка прохода диапазона с возможным размещением МА друг относительно друга
if (Bid> MA1 && Bid< MA2) || (Bid< MA1 && Bid> MA2)) 
{

and here


if (Bid > MA1 && Fact_Up==true) // Check for upward pass
{
Fact_Dn=true; // Report a price above MA1
Fact_Up=false; // Not to report price below MA1
Alert("Price is above the range.");// Message
}
//--------------------------------------------------------------------
if (Bid < MA2 && Fact_Dn==true) // Check for a downward move
{
Fact_Up=true; // Report a price below MA2
Fact_Dn=false; // Not to report a price above MA2
Alert("Price is under the range.");// Message
}

The author wanted to say that the signal should be given only once. And then the flag is immediately reset to False, and until the price is below MA2 the signal to the passed side will not appear.

 
sergeev >>:


копировщик сделок назвывается. на сайте в кодебазе есть.

Thank you.

 
sergeev писал(а) >>

it will signal because you have a condition or ( || )

you need to put AND ( && ).

and here

what the author meant to say is that you only have to signal once. And then the flag is immediately reset to False and until the price is less than MA2 the signal to the passed side will no longer appear.

Thanks for the answer. the only thing that confuses me is this: if (Bid> MA1 && Bid< MA2) || (Bid< MA1 && Bid> MA2))

I have two MAs, one (MA1) is plotted along High, the other (MA2) along Low. But here it turns out that the condition is met when the price is higher than High and simultaneously lower than Low if && is set.

Maybe I'm getting it wrong, but my reading of this line is: If price is above МА1 and below МА2 or below МА1 and above МА2, then...

now I wrote it like this:

if (Bid > MA1 && Open < MA1) // Проверка прохода диапазона вверх
{
Alert("Цена находится выше диапазона.");// Сообщение
}
else
{
if (Bid < MA2 && Open > MA2) // Проверка прохода диапазона вниз
{
Alert("Цена находится ниже диапазона.");// Сообщение
}
}

In this case, as soon as the bar opened inside the range crosses the MA, the EA gives a signal, but continues to give it every time a new tick comes. and i try to make it not give it on the next ticks after the signal has appeared. (Don't judge, I am not very good at it)
 
If I want to get a reverse position on my account, instead of sell - buy, instead of TP - SL, instead of SL - TP, with pending trades according to the same scheme, I will be very grateful, but within reasonable limits.
 

Folks, help with OrderType(), it refuses to work after it, it's fine without it. What can be the error?

if(z==1){
OrderSelect(0, SELECT_BY_POS, MODE_TRADES);
double pbt=OrderOpenPrice();
OrderSelect(1, SELECT_BY_POS, MODE_TRADES);
double pst=OrderOpenPrice();
double veha1=(pbt-pst+kon)*10000;
OrderSelect(1, SELECT_BY_POS, MODE_TRADES);
if(OrderType()==OP_SELL && c==0){ <--------------------------------------------------------------------------------------------
Print("Work ", veha1);
b11=OrderSend(Symbol(),OP_BUYSTOP,Lots,pbt+Point*10,3,0,0, "b11",1,0,Blue);
s2=OrderSend(Symbol(),OP_SELLSTOP,Lots,pst-Point*10,3,0,0, "s2",2,0,Red);
OrderSelect(1, SELECT_BY_POS, MODE_TRADES);
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*40,Ask-Point*veha1,0,Red);
c=1;
}

Thank you in advance!

 
if( z==1)
{
   OrderSelect(0, SELECT_BY_POS, MODE_TRADES);
   double pbt=OrderOpenPrice();
   OrderSelect(1, SELECT_BY_POS, MODE_TRADES);
   double pst=OrderOpenPrice();
   double veha1=( pbt- pst+ kon)*10000;
   OrderSelect(1, SELECT_BY_POS, MODE_TRADES);
   if(OrderType()==OP_SELL && c==0)
   { <--------------------------------------------------------------------------------------------
      Print("Работоспособность ", veha1);
      b11=OrderSend(Symbol(),OP_BUYSTOP, Lots, pbt+Point*10,3,0,0, "b11",1,0,Blue);
      s2=OrderSend(Symbol(),OP_SELLSTOP, Lots, pst-Point*10,3,0,0, "s2",2,0,Red);
      OrderSelect(1, SELECT_BY_POS, MODE_TRADES);
      OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*40,Ask-Point* veha1,0,Red);
      c=1;
   }
}
What kind of orders do you open, not pending orders?
 

{ <--------------------------------------------------------------------------------------------

This one, what the hell is it?

 

Yeah, I open a pendent. when it goes to market, 1 more opens and the existing ones on the market change.

{ <--------------------------------------------------------------------------------------------

This, what the hell is this?

just showed me where the problem is=)

Reason: