Description
this bot close all position and cancel all order after get step profit percent.
step calculate by ((equity/balance)-1)*100
support us for more free indicator and bot by sign up in LiteFinance broker from this link
update: Net 6
using System;
using System.Linq;
using cAlgo.API;
namespace cAlgo
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class AWCPStep : Robot
{
[Parameter("Take Profit Percent", DefaultValue = 3.1)]
public double tpPercent { get; set; }
protected override void OnStart()
{
}
protected override void OnTick()
{
//calc STEP Percent Profit
double StepPercent = ((Account.Equity / Account.Balance) - 1) * 100;
foreach (var position in Positions)
{
if (StepPercent > tpPercent)
{
ClosePositionAsync(position);
}
}
foreach (var order in PendingOrders)
{
if (StepPercent > tpPercent)
{
CancelPendingOrder(order);
}
}
}
}
}
IR
IRCtrader
Joined on 17.06.2021
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: AW CP Step.algo
- Rating: 0
- Installs: 1481
- Modified: 08/07/2022 06:33
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.
No comments found.