AW CP Daily free

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

AW Close Position.

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

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 AWCPDaily : Robot
    {


        [Parameter("Take Profit Percent", DefaultValue = 3.1)]
        public double tpPercent { get; set; }

        protected override void OnStart()
        {

        }

        protected override void OnTick()
        {
            double DailyNet1 = Positions.Sum(p => p.NetProfit);
            double DailyNet2 = History.Where(x => x.ClosingTime.Date == Time.Date).Sum(x => x.NetProfit);
            double DailyNet = Math.Round(DailyNet1 + DailyNet2, 2);

            // get Starting Balance
            var oldTrades = History.Where(x => x.ClosingTime.Date != Time.Date).OrderBy(x => x.ClosingTime).ToArray();
            double StartingBalance;

            if (oldTrades.Length == 0)
            {
                StartingBalance = History.Count == 0 ? Account.Balance : History.OrderBy(x => x.ClosingTime).First().Balance;
            }
            else
            {
                StartingBalance = oldTrades.Last().Balance;
            }


            //calc Daily Percent Profit

            double DailyPercent = DailyNet / StartingBalance * 100;

            foreach (var position in Positions)
            {
                if (DailyPercent > tpPercent)
                {
                    ClosePositionAsync(position);
                }

            }

            foreach (var order in PendingOrders)
            {
                if (DailyPercent > tpPercent)
                {
                    CancelPendingOrder(order);
                }
            }

        }

    }


}

Comments

ChristianFransson - April 18, 2022 @ 10:26

A well-written bot for day trading, its practical application is another matter. Daily profit is good, but the price can go further in your direction and you have already automatically closed the trade. The problem here is that over the distance you will find it difficult to calculate your risk management. I think this is a very interesting trading bot, you can also read trading bot reviews and think about how it can be used together with other trading robots... I think this question will be more than relevant for daytraders.

 

nobit2021 - September 12, 2022 @ 06:55

Retro games is home for classic games and old games. This collection includes super classic games from the 1980s and 1990s of several legendary early gaming consoles like Nintendo Entertainment System (NES), Super Nintendo (SNES), Nintendo 64 (N64), Game Boy (GB), Game Gear (GG), Sega Master System (SMS), Sega Mega Drive (Genesis), NEC, Atari 7800, Atari Lynx, Atari Jaguar. This site is created with the desire to preserve games created for platforms and consoles that are no longer supported by developers and manufacturers, including Nintendo, Sega, Atari, and many more. These games bring back the old memories of when you own one or two of these platforms and play classic games. And revisiting those memories can be a wonderful experience. You can turn back time and do that right now for free, online, in your browser!
 

podoc78385 - November 18, 2022 @ 09:37

Hi Everyone, welcome to AW CP Daily, a blog detailing all things about Amazon Web Service. Now you can check bestcasino24 for more new casino games. I'm another AWSaholic and this blog is written for everyone who is about to learn something new about AWS or is already working with it in one way or another.

patrickgraham2901 - November 29, 2022 @ 10:44

Are you looking for a way to take your Nintendo DS gaming to the next level? If so, you need to check out our huge selection of Nintendo DS ROMS. We have all of the latest and greatest titles, including classics like Super Mario Bros. and Zelda: A Link to the Past. Whether you're a seasoned gamer or just getting started, we have the perfect game for you.

Our Nintendo DS ROMS are easy to use and install, and they're compatible with all major models of the Nintendo DS. So what are you waiting for? Get in on the fun today!

0