AW CP Step free

by khoshroomahdi in category Other at 20/08/2021
Description

this bot close all position and cancel all order after get step profit percent.

step calculate by ((equity/balance)-1)*100

 

update: Net 6

Warning! Executing the following cBot may result in loss of funds. Use it at your own risk.
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgo
´╗┐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);
                }
            }

        }

    }


}

Comments

RiseUp - April 25, 2022 @ 14:40

I would love to see something like this in the cryptocurrency market, I think it is more relevant now. Look at bitcoin bank traders crypto trading bot review so it is almost implemented, but I think there is something to fix and improve. Looking forward to your trading robots in the cryptocurrency market.

0