DA
Topics
09 Mar 2023, 11:13
1601
3
30 Jun 2020, 13:27
1289
4
05 Sep 2017, 21:33
2128
2
03 Aug 2017, 10:20
2489
2
09 Jul 2017, 14:37
2683
4
09 Jul 2017, 14:14
2980
3
22 Jan 2017, 10:36
2995
5
04 Jan 2017, 19:20
1711
2
30 Dec 2016, 10:17
2671
2
20 Dec 2016, 05:42
2398
1
12 Dec 2016, 16:03
2644
5
12 Dec 2016, 09:15
2069
1
26 Nov 2016, 10:36
2877
7
23 Nov 2016, 13:04
2260
3
23 Nov 2016, 12:41
2350
3
26 Oct 2016, 13:40
2917
4
22 Oct 2016, 07:31
2
1006
2
17 Oct 2016, 00:14
5369
8
10 Oct 2016, 11:51
3671
5
10 Oct 2016, 11:47
2766
4
Replies
davidp13
13 May 2014, 17:19
RE:
cAlgo_Fanatic said:
Are you refering to a robot /algos/show/225?
If so, are you asking about running the same forex robot twice on the same currency?
Please clarify a little or post the code if this is not the robot you are referring to with a small description of the logic.
Hi C
How can I add a StopLoss to this robot?
@davidp13
davidp13
02 Jun 2014, 21:39
Guess this can work...
public class CloseProfitablePositions : Robot
{
protected override void OnTick()
{
if (Account.Equity - Account.Balance > 250)
{
foreach (var position in Account.Positions)
{
Trade.Close(position);
}
}
//Close on negative
if (Account.Equity - Account.Balance < -100)
{
foreach (var position in Account.Positions)
{
Trade.Close(position);
}
}
}
}
@davidp13