Category Other  Published on 29/06/2023

AW CP Step

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

LiteFinance Signup

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
Comments
Log in to add a comment.
No comments found.