Close trade automatically

 

Just starting this thread. Don't know where it will go.

I am running a demo on several currency pairs using two EA's.

An analysis of the past two weeks indicate to me that after a number of positive trade along comes a stop loss that wipes all or most of the profit out. I have also noted, on the forums, people are trying to deal with this by adjusting, risk,stop loss, etc.

I took a closer look at the length of time that a trade was open. I found that most positive trade stayed open for less than an hour, a few up to 9 hours. But, the losing trade was open for much longer than that trying to find either a TP or a SL.

So on the platform statement I crossed out (eliminated) all of the trades open for more than two hours and the result was a much better profit albeit fewer trades. But I think that is the name of the game. PROFIT OVER TRADES. This little experiment cut off ALL the losers.

I would like to try this by writing some code that will closed an open trade automatically after a certain number of hours. This number to be adjustable by the trader.

Some other considerations:

1. the code must be specific to a trading chart. It would be nice to load the code in a similar fashion as we do EA's.

2. the code must be portable. That is in a scrip or an EA.

I used to do some programming in FoxPro but am rusty. I know nothing about programming in this language. Is there a list of command and their meaning some where I can look at?

Anybody willing to help me on this?

Bill

 

Reading further I have some questions;

1.A script is one time event and would not be appropriate for my scheme. Correct?

2. It looks like my approach would have to be in a specific EA. Correct?

3. Should the code be placed in a .dll?

4. Would I have to write two sets of code, one for Euro-Blaster and one for Fap Turbo? Is an add on permissible on these EA's?

 

One tool should be on this thread https://www.mql5.com/en/forum/173000

 

Thanks,

However those tools appear to be scripts. They only work once as I understand it. What I need is some sort of tool that will monitor open trades, keep track of their identifier and close them after a certain length of time.

Bill

 

Not many people jumping in. Would I get better response from an ELITE membership?

I don't even know where this code should go once written, the EA, a .dll or what?

Bill

 
...monitor open trades, keep track of their identifier and close them after a certain length of time.

It should be EA. Scripts are not doing this kind of job.

There are many EAs which can monitor the trades. But to know which one can close all the trades - it is necessary to go through every single EAs (there are many of them) just to understand which one is closing all open trades on certain time. It is basicly half a day for this it.

Because of that no one replied: it is necessary to spend at least half a day for reply ...

As I see there are the following EAs:

- TimeBreakExpert EA: open and close the orders at established time (Trailing Stop and BreakEven). There are 2 threads in elite section with 2 versions. Coded by Igorad.

- ScheduleTrader EA: open/close the trades (any kind of) in established time. It is the public development. The thread is here: https://www.mql5.com/en/forum/177102

- WNV EA: this EA buys and/or sells at a certain time of day. One thread is on elite section. Idea is by WNV, coded by Igorad.

- TimeBasedEA: buy and sell specific currency pair at specific time is (many versions). Public EA. The thread is here https://www.mql5.com/en/forum/177263

Thre are many other EAs in public threads and in elite threads (MultiPositionExpert EA; BreakEvenExpert EAs; EMATrailing Stop EA; CloseAll-PL EA; CloseTrades_After_Account_Profit_Reached EA; Trail Strength_Trend Stop; EquityMangager V2; EquityWatch; Close All Trades When Once Profit Taken EA; Swiss Army EA (Automatic order management) and so on).

But as I said - to reply to your questions - it is necessary to spend may be 1 full day ... and in the end you may say that you do not need it ... and it will be the other day ... and so on

That is why no one replied.

Reason: