demlin: Yes Instr is, sorry don't know what SRC is
When you paste the code into your post press CTRL+ALT+M - then put the code there (through the buffer CTRL+C - copy, CTRL+V - paste), then press the "paste" button at the bottom of the window.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Here is another question .... i have an open order like this:
OrderSend("EURUSD",OP_BUY,0.1,C1,10,Bid-0.0017-0.0017,Ask+0.0017);
how to open another order if this one closes at takeprofit????
did you readthe book ? (at least for fun)
I've read..... 3 times and yet?
In the loop on the history of closed orders, find "this" order, then check whether it closed on TP, if so, then open a "different". That is all.
See here for more details - select the fi ries you need, plug them into your software and that's it.
Thank you very much!
Enjoy it.
Good evening!
Please take a look at the code:
for(i=1;i<=OrdersTotal();i++) // retrieve orders for trawl
{
if(OrderSelect(i-1,SELECT_BY_POS)==true)
{
if (OrderSymbol()!=Instr)
continue;
if(OrderType()==0)
{
if ((Bid-(OrderOpenPrice()+TralingStop*Point))>0)
return(55);}
if(OrderType()==1)
{
if ((Ask-(OrderOpenPrice()-TralingStop*Point))<0)
return(55);
}
}
I don't understand what the problem is, I'm testing with an Alert inside, it doesn't work anywhere else after Instr
Good evening!
Please take a look at the code:
for(i=1;i<=OrdersTotal();i++) // retrieve orders for trawl
{
if (OrderSelect(i-1,SELECT_BY_POS)==true)
{
if (OrderSymbol()!=Instr)
continue;
if(OrderType()==0)
{
if ((Bid-(OrderOpenPrice()+TralingStop*Point))>0)
return(55);}
if(OrderType()==1)
{
if ((Ask-(OrderOpenPrice()-TralingStop*Point))<0)
return(55);
}
}
I don't understand what the problem is, I'm testing with an Alert inside, it doesn't work anywhere else after Instr
Is there a line like this above the code?
string Instr;Insert the code properly - via SRC in the editor... :-)))Is there a line like this above the code? Insert the code properly - via SRC in the editor... :-)))
Yes Instr is, sorry don't know what SRC is
When you paste the code into your post press CTRL+ALT+M - then put the code there (through the buffer CTRL+C - copy, CTRL+V - paste), then press the "paste" button at the bottom of the window.
Good evening!
Please take a look at the code:
for(i=1;i<=OrdersTotal();i++) // retrieve orders for trawl
{
if (OrderSelect(i-1,SELECT_BY_POS)==true)
{
if (OrderSymbol()!=Instr)
continue;
if(OrderType()==0)
{
if ((Bid-(OrderOpenPrice()+TralingStop*Point))>0)
return(55);}
if(OrderType()==1)
{
if ((Ask-(OrderOpenPrice()-TralingStop*Point))<0)
return(55);
}
}
I don't understand what the problem is, I'm testing with an Alert inside, it doesn't work anywhere else after Instr
Try this option - this is how I have a similar design organised.