[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 423

 
drknn:


The easiest way is to use the function OrdersHistoryTotal: go through the history and see if the order with the necessary magician is in the history, it means that it was closed or deleted.

You can also add some sorting condition in the history order loop. For example, if the time of order closing is less than the opening time of today, then such an order will be ignored. As a result, the Expert Advisor will sort out only the orders closed/deleted today.

Great, thanks.
 
Dimka-novitsek:

Tell me, for a remote order, is it possible to know if it was closed at takeprofit or otherwise?

Can you use the function

double OrderTakeProfit( )
Returns the closing price of the position when the profit margin (take profit) for the currently selected order is reached
The order must be pre-selected using the OrderSelect() function.
?

Can we create a condition like this

Will this function return more than zero for any order if it was closed, i.e. what would be the profit?

1)

for ( i=OrdersTotal()-1;i>0;i--)

2) OrderTakeProfit( ) returns the take profit price of the order, not the profit.

if

OrderClosePrice( ) )

is equal to OrderTakeProfit( ), then it is closed at TakeProfit



 

ilunga:


1)

2) OrderTakeProfit( ) returns the take profit price of the order, not its profit.

If

OrderClosePrice( )

is equal to OrderTakeProfit( ) then it is closed by TakeProfit




Thank you!

Yes, that's right! Cool!!!

 

Good day to you all!

Please clarify 1 question. I have written an EA. I want to transfer it to another... I do not know how to say: from forex to insta forex). I went to the Expert Advisor, but the file does not exist! Where is it? It is only visible within the forex forex

 
demlin:

Good day to you all!

Please clarify 1 question. I have written an EA. I want to transfer it to another... I do not know how to say: from forex to insta forex). I went to the Expert Advisor, but the file does not exist! Where is it? It is only visible within the forex forex


What is your operating system?
 
Vinin:

What is the operating system?
7 Windows
 
 
Thank you, one more question: C:\Users\<User Name>\AppData\Local\VirtualStore\Program Files\
 
demlin:
Thank you, one more question: C:\Users\<User Name>\AppData\Local\VirtualStore\Program Files\.

C:\Users<Username><AppData<Local\VirtualStore\Program Files
 
demlin:

Good day to you all!

Please clarify 1 question. I have written an EA. I want to transfer it to another... I do not know how to say: from forex to insta forex). I went to the Expert Advisor, but the file does not exist! Where is it? only visible within the forex forex

There is another option:

In the MetaEditor, in the File tab, select "save as ... ...", usually all programs in this case use the default folder to save the file.

Reason: