PDA

View Full Version : Important! Close pending orders..



Meticienta
10:08,
I need help real fast, and would really love if someone could help me... it think's it is a simple issue, but I simply can't get it


I will open a position and some pending orders. When the open position has reach it is profittarget, I want all the pending orders to be deleted. (This works). My issue is that I can't get the condition if the open positions is shut.

I was hoping there is some control for to test if profittarget is stuffed...

I tried another solution, by conducting trough all orders (opened and pendings) and to count how many open positions it were (OP_BUY) with this code:

Inserted Code int complete = OrdersTotal(), totalopen=0for(I=total-1;igt;=0;I--) OrderSelect(I, SELECT_BY_POS); int form =OrderType(); if(kind ==OP_BUY) totalopen ; //if if(totalopen==0) {. .
The codes that comes following... I know works, it is the terms I've fucked up somehow. .

Everybody? I love quick help!

Thanks in advance