Category Other  Published on 04/02/2022

TradingView Trading Tool

Description

TradingView like trading tool, you can open positions using the drawing trading tool. The orders can be market orders or stop orders.

I have a trial version and the complete version.

For more info contact me via telegram: 

https://t.me/murillo_6

Note: this is the first version, so major improvements are coming :)


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


        protected override void OnStart()
        {
            var text = new TextBlock 
            {
                Text = "Contact me via telegram https://t.me/murillo_6",
                Margin = "0 0",
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Center,
                FontSize = 20,
                TextWrapping = TextWrapping.Wrap,
                Style = Styles.CreateHeaderStyle()
            };

            var border = new Border 
            {
                VerticalAlignment = VerticalAlignment.Stretch,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                Style = Styles.CreatePanelBackgroundStyle(),
                Margin = "10 10 10 10",
                Width = 225,
                Child = text
            };
            Chart.AddControl(border);
        }

        protected override void OnTick()
        {
            // Put your core logic here
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
    public static class Styles
    {
        public static Style CreatePanelBackgroundStyle()
        {
            var style = new Style();
            style.Set(ControlProperty.CornerRadius, 3);
            style.Set(ControlProperty.BackgroundColor, GetColorWithOpacity(Color.FromHex("#292929"), 0.85m), ControlState.DarkTheme);
            style.Set(ControlProperty.BackgroundColor, GetColorWithOpacity(Color.FromHex("#FFFFFF"), 0.85m), ControlState.LightTheme);
            style.Set(ControlProperty.BorderColor, Color.FromHex("#3C3C3C"), ControlState.DarkTheme);
            style.Set(ControlProperty.BorderColor, Color.FromHex("#C3C3C3"), ControlState.LightTheme);
            style.Set(ControlProperty.BorderThickness, new Thickness(1));

            return style;
        }

        public static Style CreateCommonBorderStyle()
        {
            var style = new Style();
            style.Set(ControlProperty.BorderColor, GetColorWithOpacity(Color.FromHex("#FFFFFF"), 0.12m), ControlState.DarkTheme);
            style.Set(ControlProperty.BorderColor, GetColorWithOpacity(Color.FromHex("#000000"), 0.12m), ControlState.LightTheme);
            return style;
        }

        public static Style CreateHeaderStyle()
        {
            var style = new Style();
            style.Set(ControlProperty.ForegroundColor, GetColorWithOpacity("#FFFFFF", 0.70m), ControlState.DarkTheme);
            style.Set(ControlProperty.ForegroundColor, GetColorWithOpacity("#000000", 0.65m), ControlState.LightTheme);
            return style;
        }





        private static Color GetColorWithOpacity(Color baseColor, decimal opacity)
        {
            var alpha = (int)Math.Round(byte.MaxValue * opacity, MidpointRounding.AwayFromZero);
            return Color.FromArgb(alpha, baseColor);
        }
    }
}


OS
oscarm666666

Joined on 06.11.2021

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: TradingView cTDN.algo
  • Rating: 0
  • Installs: 2369
  • Modified: 04/02/2022 21:42
Comments
Log in to add a comment.
WE
weelmedia · 1 year ago

Your writing is excellent, so allow me to share a little of myself. One of the best available limitless running games is nytimes crossword. Control your ball as you compete in a fast ramp race to see how far you can climb the leaderboard.

ZJ
zjaoshinn29 · 2 years ago

I found this to be an excellent source of knowledge. I appreciate you sharing this. It has a certain allure for me mapquest driving directions