[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 459

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.