Description
If you want to close all positions after profit, this is for you. All you need to do is rewrite how much money you need before automating your positions. Cbot closes all positions, including pending orders!
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class closeallpositionafterprofit : Robot
{
protected override void OnTick()
{
if (Account.Equity - Account.Balance > 10)
{
foreach (var position in Account.Positions)
{
Trade.Close(position);
}
foreach (var order in PendingOrders)
{
CancelPendingOrder(order);
}
}
}
}
}
M.
m.kepka.90
Joined on 03.11.2021
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: close all position after profit.algo
- Rating: 0
- Installs: 2011
- Modified: 23/11/2021 10:15
Warning! Running cBots downloaded from this section may lead to financial losses. Use them at your own risk.
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
OM
Hi,
I'm interested in this bot, question, if I'm running a 4 currencies all with different dollar value profit targets can I set this robot to each of the charts and set it up for each different currencies separately?
Hello, Neat post. There is an issue along with your site in web explorer, could test this¡K IE still is the marketplace leader and a huge portion of other people will miss your magnificent writing because of this problem. 바카라사이트