Description
This cbot will amend your SL for manually created positions if the comment of the positions matches with the comment parameter with a bot. To not move the SL to early to break even, it will set the SL to the ATR value only after 1) close and open are below the ATR and the ATR Value is below entry price. Managing many positions was never that easy. If there is a demand for a PSAR one i can create one too. This little helper is not free and can be purchased at Gumroad (25€ one time payment).
ATR Indicator can be found here: https://ctrader.com/algos/indicators/show/349
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
namespace cAlgo
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
public class ATRStops : Robot
{
[Parameter(DefaultValue = 0.0)]
public double Parameter { get; set; }
private static bool trigger = false;
protected override void OnStart()
{
ShowDialogBox();
}
protected override void OnTick()
{
}
protected override void OnStop()
{
trigger = false;
}
public static void ShowDialogBox()
{
if (trigger)
{
return;
}
var msg = MessageBox.Show("The full version of this bot can be bought on Gumroad.com, visit now?", "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (msg == DialogResult.Yes)
{
System.Diagnostics.Process.Start("https://gumroad.com/products/cDzgd");
}
trigger = true;
}
}
}
2bnnp
Joined on 12.02.2019
- Distribution: Paid
- Language: C#
- Trading platform: cTrader Automate
- File name: ContactForm.algo
- Rating: 5
- Installs: 1547
- Modified: 13/10/2021 09:54
Comments
To clarify, if the price TOUCHES or CLOSES above/below the ATR Trailing line (depending on whether you are long or short), the position you manually created will be closed.
Closes on touch, it adjusts the stop.
Hi there..it sounds interesting but im not sure i got it 100%..so this is a ATR trailing stop that automatically closes your manual entered position if price TOUCHES or CLOSES above/below the ATR Trailing line depending if you re long or short?
grazie