Yes, if the first part opens an order, the second part will not close it
ok, what am i doing wrong then?
that sounds like it, i though they were the same thing
...
...
if (OrderSelect(123456,SELECT_BY_TICKET) == true) Print("Unbelieveable! I found it"); // add this line
if (OrderSelect(123456,SELECT_BY_TICKET) == false) Print("Not found, told you so."); // add this line
if (OrderSelect(123456,SELECT_BY_TICKET) == true)
{
OrderClose(123456,1,Ask,5,CLR_NONE);
...
...
wait, so those 2 print lines are all thats missing?
No. That is a test.
phy:
No. That is a test.
Hi phy,
Can you please help me with this indicator? the arrows will not update and I'm no good at codes. Attached indi. Thanks in advance!!
Files:
wprrdiv.mq4
13 kb
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
this code looks right to me, but I must be missing something because it will not work...
Open order-
if (OrderSelect(123456,SELECT_BY_TICKET) == false )
{
OrderSend(Symbol(),OP_SELL,1,Bid,3,StopLose,TakeProfit,"Short Open",123456,0,White);
return(0);
}
close open order-
if (OrderSelect(123456,SELECT_BY_TICKET) == true)
{
OrderClose(123456,1,Ask,5,CLR_NONE);
return(0);
}
It opens them ok, but will not close them...
tia for any help