close all orders with the same TakeProfit
close all orders with the same TakeProfit
01 Sep 2012, 02:04
hello
I want to spend (with a single instance) several orders to buy or sell up to get a TakeProfit and close all orders with the same TakeProfit
for example
[Parameter ("Take Profit", DefaultValue = 10)] ..
("10", all accumulated orders)
excuse my bad English spoken
cordially
tradermatrix
Replies
tradermatrix
03 Sep 2012, 18:18
yes I want to cut with TakeProfit when, for example P & L = 10
[Parameter("Take Profit", DefaultValue = 10)]
EXEMPLE RANGE ROBOT(or another robot)
ID | Heure | Symbole | Volume | Type | Entrée | T/P | S/L | Pips | Swap | Commissions | EUR | ||||||||||
195826 | 03/09/2012 14:39 | EURUSD | 10k | Sell | 1.25745 | -0.3 | 0.00 | -0.30 | -0.24 | ||||||||||||
195833 | 03/09/2012 14:42 | EURUSD | 10k | Sell | 1.25745 | -0.3 | 0.00 | -0.30 | -0.24 | ||||||||||||
195862 | 03/09/2012 15:15 | EURUSD | 10k | Buy | 1.25682 | 5.8 | 0.00 | -0.30 | 4.61 | ||||||||||||
195875 | 03/09/2012 15:21 | EURUSD | 10k | Buy | 1.25709 | 3.1 | 0.00 | -0.30 | 2.47 | ||||||||||||
195899 | 03/09/2012 15:51 | EURUSD | 10k | Buy | 1.25702 | 3.8 | 0.00 | -0.30 | 3.02 | ||||||||||||
195945 | 03/09/2012 16:28 | EURUSD | 10k | Sell | 1.25692 | -5.6 | 0.00 | -0.30 | -4.45 | ||||||||||||
195955 | 03/09/2012 16:36 | EURUSD | 20k | Sell | 1.25692 | -5.6 | 0.00 | -0.60 | -8.91 | ||||||||||||
195962 | 03/09/2012 16:41 | EURUSD | 10k | Buy | 1.25694 | 4.6 | 0.00 | -0.30 | 3.66 | ||||||||||||
195965 | 03/09/2012 16:44 | EURUSD | 20k | Buy | 1.25698 | 4.2 | 0.00 | -0.60 | 6.68 | ||||||||||||
195982 | 03/09/2012 16:49 | EURUSD | 10k | Buy | 1.25696 | 4.4 | 0.00 | -0.30 | 3.50 | ||||||||||||
196035 | 03/09/2012 17:21 | EURUSD | 10k | Sell | 1.25742 | -0.6 | 0.00 | -0.30 | -0.48 | ||||||||||||
TRADERMATRIX |
|||||||||||||||||||||
|
@tradermatrix
tradermatrix
06 Sep 2012, 14:57
bonjour
Unfortunately not, I want to automatically close all orders Buy and Sell when P & L = 10
the method closes the orders (profit = 10) one after the other
cordialement
TRADERMATRIX
@tradermatrix
tradermatrix
06 Sep 2012, 21:17
YES!
thank you very much
I can make beautiful robots
see you soon
TRADERMATRIX
@tradermatrix
leo8three
14 May 2014, 17:47
RE: Hello,
Hi
do we need the declaration:
using cAlgo.API.Internals;
to make it works?
Thanks a lot
admin said:
The below code must be what you might need:
protected override void OnTick() { if( Account.Equity - Account.Balance > 10 ) { foreach (var position in Account.Positions) { Trade.Close(position); } } }
Let us know if that worked for you!
@leo8three
admin
03 Sep 2012, 10:04
Hi
You want to set the same Take Profit and Stop Loss for all your positions? Is that correct?
@admin