EA for close all open trades hit profit for one pair only

To add comments, please log in or register
wowos
91
wowos  

hi dear,

this ea close all open and pending trades for one pair once you put it in the pair chart, and not close the other trades

can you modify it to do that only if the open trades for the specific pair ( positive + negative) hit x profit in usd

for example, when the sum of total open trades for the specific pair = 5 usd profit

and 2 features first i can change my target profit, and the other i can change the pair

i don't have any mql background, so i'll be apprecited for that.

thanks in advance

gpociejewski
57
gpociejewski  
wowos:
hi dear,

this ea close all open and pending trades for one pair once you put it in the pair chart, and not close the other trades

can you modify it to do that only if the open trades for the specific pair ( positive + negative) hit x profit in usd

for example, when the sum of total open trades for the specific pair = 5 usd profit

and 2 features first i can change my target profit, and the other i can change the pair

i don't have any mql background, so i'll be apprecited for that.

thanks in advance

[lang=pl]Hi its useful but i think the better is to have function for close position, sometimes you want

to close only pending or only BUY or SELL. Also if you making EA it is good to have function

for closing only onr type of orders.

Code :

void closeOrders(int oMagic,int oType) {

for(int i=0;i<OrdersTotal();i++) {

if(OrderSelect(i,SELECT_BY_POS)) {

if(OrderMagicNumber()==oMagic || oMagic<0) {

if(OrderSymbol()==Symbol()) {

if(OrderType()==oType || oType<0) {

if(OrderType()==OP_BUY) {

OrderClose(OrderTicket(),OrderLots(),Bid,0);

i--;

}

if (OrderType() == OP_BUYSTOP)

{

OrderDelete(OrderTicket());

i--;

}

if(OrderType()==OP_SELL) {

OrderClose(OrderTicket(),OrderLots(),Ask,0);

i--;

}

if (OrderType() == OP_SELLSTOP)

{

OrderDelete(OrderTicket());

i--;

}

}

}

}

}

}

}

cheers,

Grzesiek[/lang]

wowos
91
wowos  
g.pociejewski:
[lang=pl]Hi its useful but i think the better is to have function for close position, sometimes you want

to close only pending or only BUY or SELL. Also if you making EA it is good to have function

for closing only onr type of orders.

Code :

void closeOrders(int oMagic,int oType) {

for(int i=0;i<OrdersTotal();i++) {

if(OrderSelect(i,SELECT_BY_POS)) {

if(OrderMagicNumber()==oMagic || oMagic<0) {

if(OrderSymbol()==Symbol()) {

if(OrderType()==oType || oType<0) {

if(OrderType()==OP_BUY) {

OrderClose(OrderTicket(),OrderLots(),Bid,0);

i--;

}

if (OrderType() == OP_BUYSTOP)

{

OrderDelete(OrderTicket());

i--;

}

if(OrderType()==OP_SELL) {

OrderClose(OrderTicket(),OrderLots(),Ask,0);

i--;

}

if (OrderType() == OP_SELLSTOP)

{

OrderDelete(OrderTicket());

i--;

}

}

}

}

}

}

}

cheers,

Grzesiek[/lang]

hi dear,

it's better if u make it as EA

i want it count all the sell orders for eurusd if it >= x profits

close all sell orders and not close other orders

and the same for buy orders in the specified pair

thanks in advance

angrysky
104
angrysky  

Not sure if this works or is just what you want-EA found in mq library

Careful- there might be a problem.

I am not a coder either but I think there was a problem that it would try to close all orders buy or sell at the price of the currency pair it is on- so a coders help is needed-

it might work if you only have one pair you are trading.

sorry- I am trying to learn code but have a loong way to go.

Files:
wipeout.mq4 2 kb
wowos
91
wowos  
angrysky:
Careful- there might be a problem.

I am not a coder either but I think there was a problem that it would try to close all orders buy or sell at the price of the currency pair it is on- so a coders help is needed-

it might work if you only have one pair you are trading.

sorry- I am trying to learn code but have a loong way to go.

hi dear,

I tried it yesterday on my platform , but unfortionatly it didn't close sell or buy orders although i have one pair trading only

so, we still need a help from a profitional coder

thanks for ur ea

regards

angrysky
104
angrysky  

Drag all stops EA

Steve Hopwood just made this- Not sure how/if it works- not a wipeout- don't know exactly what it does if you have hedges but it's supposed to drag and drop all stops on a chart.

Let me know if you try it and if it works- I haven't tried it.

William Snyder
9397
William Snyder  
wowos:
hi dear,

this ea close all open and pending trades for one pair once you put it in the pair chart, and not close the other trades

can you modify it to do that only if the open trades for the specific pair ( positive + negative) hit x profit in usd

for example, when the sum of total open trades for the specific pair = 5 usd profit

and 2 features first i can change my target profit, and the other i can change the pair

i don't have any mql background, so i'll be apprecited for that.

thanks in advance

Hi Wowos,

There's a multi position Ea if you set the magic number it will close the pair it is on.

https://www.mql5.com/en/forum/176181

angrysky
104
angrysky  

Entry TP/SL fast Mod idea.

draw a trend line on the chart- if it is above/below price then when price closes across it it buys or sells x lots depending on selection, it should also be able to close x lots when it gets hit-

you could just click and place preset orders- stops and tp preset by risk and atr% maybe and verticle lines 1 for each horizontal if you want to include time.

What I was thinking of originally was just a horizontal line you could just drag up and down with all your lot size, stop loss and tp pre set-

then when it triggers a second 2 lines pop up- the tp and sl- but you can drag them by just clicking.

Would that exist somewhere or worthy of a coders attention?

Thanks,

Ty

pavaka
4413
pavaka  

...

yes...it does...do a search for easy ea

angrysky
104
angrysky  

Ea unuseable.

Pava:
yes...it does...do a search for easy ea

Found your post but it stayed grey and unuseable even after I restarted the platform since it was a ex and I couldn't compile it, any ideas?

Thanks.

pavaka
4413
pavaka  

...

angrysky:
Found your post but it stayed grey and unuseable even after I restarted the platform since it was a ex and I couldn't compile it, any ideas? Thanks.

give me your email...i'll send you after work working one

12
To add comments, please log in or register