I'm trying to code this logic:  

> 
> **`if`** `no open orders` **`and`** `buy logic ( DayOpen - 10 * Point )`  
> **`then`** `buy`
> 
> 
> **`if`** `bought`  
> 
> `Sell` **`when`** `the one` (and the only one) `bought order reaches Take Profit price.`
> 
> 
> 

---

Here's what I have so far:

```
double DayOpen = iOpen( NULL, PERIOD_D1, 0 );
double TP      = 10.0;
int    ticket;

if ( OrdersTotal() == 0 && Bid == DayOpen - 10 * Point );
{    OrderSend( Symbol(),
                OP_BUY,
                1.0,
                Ask,
                0,
                0,
                Ask + TP * 10 * Point,
                NULL,
                12321,
                0,
                Blue
                );
}

```