Closing a manually opened position

sense
19
sense  

Hi,

I'm trying to write a simple script to close a manually opened position, but I do not know how to let the system to "detect" an opened position. Need advise on this. Or is there any sample available? Thanks.

Brian Dee - Random Trader
1756
Brian Dee - Random Trader  

S

There are some sample scripts that come with MT

Also search the forum?

https://www.mql4.com/search/script%20close%20order

-BB-

Kutluhan Yesilkaya
471
Kutluhan Yesilkaya  
duyu :

Selam,

Manuel olarak açılmış bir işaretlenmiş hali için basit bir komut dosyası çalışıyorum, ancak program açık bir değil "algılamasına" nasıl izin vereceğimi bilmiyorum. Bu konuda tavsiyeye ihtiyacınız var. Veya herhangi bir örnek var mı? Teşekkürler.

hello i am having the same problem. I want ea to close the order I opened manually. how can I do it?

Keith Watford
Moderator
28041
Keith Watford  
Kutluhan Yesilkaya:

hello i am having the same problem. I want ea to close the order I opened manually. how can I do it?

A manually opened trade will have 0 for the magic number. So check for a trade with the magic number value 0 and close it.

Kutluhan Yesilkaya
471
Kutluhan Yesilkaya  
Keith Watford :

A manually opened trade will have 0 for the magic number. So check for a trade with the magic number value 0 and close it.

When the magic number becomes 0, the robot wipes itself out. It's canceling. is there any other way?

Marco vd Heijden
Moderator
13415
Marco vd Heijden  
Kutluhan Yesilkaya:

When the magic number becomes 0, the robot wipes itself out. It's canceling. is there any other way?

There are many ways.

Fix the code.

Keith Watford
Moderator
28041
Keith Watford  
Kutluhan Yesilkaya:

Do not post the same query in multiple topics!

I have deleted your duplicated posts.

With the information that you have provided, you have had all the answers that you are going to get here.

You have selfishly wasted other people's time as they have tried to be helpful and answered your other posts, but of course their answers are the same as you have already had here in this topic.

William Roeder
24230
William Roeder  
You haven't stated a problem, you stated a want. Find or have built an EA to manage the trade.
AIRAT SAFIN
1654
AIRAT SAFIN  
Kutluhan Yesilkaya:
I want to connect the manually opened position to this robot. So I will open the position and the robot will close it. How can we do?

First of all => The robot must detect new open positions

And secondly => Then the robot implements the position management logic embedded in it

Keith Watford
Moderator
28041
Keith Watford  
Kutluhan Yesilkaya:
Keith Watford:

Do not post the same query in multiple topics!

I have deleted your duplicated posts.

With the information that you have provided, you have had all the answers that you are going to get here.

You have selfishly wasted other people's time as they have tried to be helpful and answered your other posts, but of course their answers are the same as you have already had here in this topic.

This is your last warning!

I have deleted yet another post and the new topic that you started with the same question. Both posted by you a long time after I posted the above reply.

I have moved the 2 replies to your duplicate topic her.

Duplicate this query in one more topic and you will be banned.