Al-N
Al-N 's avatar

Info

Username:al-n
Name:Al-N
Member since: 03 Jan 2021

About

None

Signature

None

Last Algorithm Comments

@The real TSL (trailing-stop-loss):  03 Aug 2022, 18:08


i don´t kno how :/

@The real TSL (trailing-stop-loss):  12 Jan 2022, 16:54


hi everyone. can someone maybe help me with a snipet to modify the trailing stop loss cbot above to a hidden/stealth trailing stop loss cbot?!? thank you

@The real TSL (trailing-stop-loss):  01 Dec 2021, 17:18


hi there. is it possible to make the cbot put the first tsl  immediately as soon as it is activated by the play button and thereafter it starts folowing the current price per tick?!? thank you

@cTrader Scalpers Buddy:  20 Apr 2021, 21:42


Hi there. Is it please possible to add an email alert to this indicator? It would be so helpful

Last Forum Posts

@compatibility with .NET 6.0:  04 Aug 2022, 11:39


hi everybody.

can someone please help to modificate the following tsl bot to be able to work wir ctrader 4.2.17  ?!?!


i have already tried to "build" the source code with "taget framework -> .NET 6.0". but unfortunately it didn't work.

´╗┐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 my_tsl : Robot
    {
        [Parameter("Instance Name", DefaultValue = "")]
        public string InstanceName { get; set; }
        [Parameter("Include Trailing Stop", DefaultValue = true)]
        public bool IncludeTrailingStop { get; set; }
 
        [Parameter("Trailing Stop Trigger (pips)", DefaultValue = 2)]
        public double TrailingStopTrigger { get; set; }
 
        [Parameter("Trailing Stop Step (pips)", DefaultValue = 1)]
        public double TrailingStopStep { get; set; }
 
 
 
        protected override void OnStart()
        {
            // Put your initialization logic here
        }
 
        protected override void OnTick()
        {
            if (IncludeTrailingStop)
            {
                SetTrailingStop();
            }
            // Put your core logic here
        }
        private void SetTrailingStop()
        {
            var sellPositions = Positions.FindAll(InstanceName, Symbol, TradeType.Sell);
 
            foreach (Position position in sellPositions)
            {
                double distance = position.EntryPrice - Symbol.Ask;
 
                if (distance < TrailingStopTrigger * Symbol.PipSize)
                    continue;
 
                double newStopLossPrice = Symbol.Ask + TrailingStopStep * Symbol.PipSize;
 
                if (position.StopLoss == null || newStopLossPrice < position.StopLoss)
                {
                    ModifyPosition(position, newStopLossPrice, position.TakeProfit);
                }
            }
 
            var buyPositions = Positions.FindAll(InstanceName, Symbol, TradeType.Buy);
 
            foreach (Position position in buyPositions)
            {
                double distance = Symbol.Bid - position.EntryPrice;
 
                if (distance < TrailingStopTrigger * Symbol.PipSize)
                    continue;
 
                double newStopLossPrice = Symbol.Bid - TrailingStopStep * Symbol.PipSize;
                if (position.StopLoss == null || newStopLossPrice > position.StopLoss)
                {
                    ModifyPosition(position, newStopLossPrice, position.TakeProfit);
                }
            }
        }
        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

@how to compare candle body size of two previous candles:  10 Jun 2022, 16:41


double candle1SizePips = Math.Round(candle1Size / Symbol.PipSize, 3);

can someone tell me what this lines does? 

i mean in this line:
double candle1Size = Math.Abs(MarketSeries.Open.Last(1) - MarketSeries.Close.Last(1));

-> he defines the variable candle1Size. The (1) in brackets represents the first-last candle. ok, that´s logical. but what happens here then?

double candle1SizePips = Math.Round(candle1Size / Symbol.PipSize, 3);

I mean PIP you can only specify in a price range and not for a spot or market price. And most importantly, what does the 3 mean here?

Actually I´m trying to program a breakout for the last candle for example 10 pips above the privious candle. would you solve the conditional decalaration this way?

thank you

@how to understand the api parameters:  10 Jun 2022, 12:06


ok thnx

@how to understand the api parameters:  09 Jun 2022, 22:28


hi there. can somone help me to understand how to learn the meaning of the parameters of the automate api methods to use them in a cbot for example?

for example i looked for ATR indicator.

here:
https://spotware.github.io/ctrader-automate/references/Indicators/IIndicatorsAccessor/AverageTrueRange/?h=atr

.... i get the 3 types of examples. but there is for example no explaination what marketSeries does. or by the example (3of3) is the parameter bars. and also there is no description. 
 

how can i find what those parameters do stand for?

thank you

@need help to understand this bot: "Daily Candle Breakout":  06 Jun 2022, 12:07


amusleh said:

Hi,

You should post this on that cBot comments section, and the developer can help you.

ok thank you.

@need help to understand this bot: "Daily Candle Breakout":  03 Jun 2022, 18:52


hi there. i found the following  bot and there are some points that i don´t really can read through. so I thought maybe someone can help me.

this is the bot: https://ctrader.com/algos/cbots/show/984

first of all on line 28-30 is written:
// Defines relevant bar minimal size

        [Parameter("Min Bar Size", DefaultValue = 66, MinValue = 1)]

        publicintminBarSize { get; set; }

..... 
and on line 36-38 the following:
 // Breakout threshold in pips

        [Parameter("Breakout Trigger In Pips", DefaultValue = 9, MinValue = 0)]

        publicintbreakoutPips { get; set; }

does that mean that for example it i choose 5 for the "Min Bar Size" and would leave the "Breakout Trigger In Pips" by 9 pips
the bot would trigger when a candle had a range of 5 pips total (inkl high/low) plus the next candle breaking out of mim 9 pips ???


 

and besides that i have tried to prevent stop loss but it still triggers somehow. 

as u can see in the screeshot the first trade ist opendes and the sl has been triggered. can someone maybe tell me why accourding to my settings on the parameter pannel?

i have set SL to  6500055 just to have enough space and "Equity Stop Loss Ratio" to zero. but it still triggerd stop loss.


 

@installing "code snippet studio" on VS.2019:  17 May 2022, 22:00


hi there. i hope i am in the right section here.

i am trying to install "code snippet studio" on my visual studio 2019 in order to be able to work with "ctrader code snippets" like shown in the video below on time-code 1:30min. But i can not find "code snippet studio" like it is described in the video. i even tried over google but it seems to work only on vs 2015. bc after downloading it i was not able to install it.

furthermore i didn´t really understand where i do get the "ctrader code snippets"  folder with its snippets like shown by minute 3:45.

do i have to download them from somewhere?

thank you.
 

@Set TP for multiple positions with one-click:  09 Nov 2021, 08:54


Hi there. Is it possible (to build a cbot) to set a take profit on the chart by darging the tp line to a certain level and copying it for more several (for example 8 or 40) trades with one click?!? 

Thank you

@autochartis + economic-calender notifiction in the ctrader-mobile app:  11 Apr 2021, 14:42


A wonderful idea was implementing autochartist and the economic-calendar into the app.
Unfortunately, you have to look repeatedly actively at the apps so that you don't miss any messages from the economic-calender or signals for patterns from autochartist.
for example here notifications would be very welcome and wonderful. because you always lag behind. with autochartist in real time alert of course, and with the economic calendar, for example 15 min and 30 min in advance. and the notifictians like the existing ones through the app. i know there is also a autochartist app but that works even much worse than your implemented feature. its such a shame.
And since your implementation works very well, I would perhaps find it easier to just include a notification here.


thank you

@deactivating annoying on-screennotification:  11 Apr 2021, 14:38


Dear sptoware team I would like to praise the wonderful cTrader app for android and would like to share some ideas with you to make the app more user friendly and effective for fulltime and high frequency traders. 
 

I´ll post here one  suggestion and an other in a seperate post for clear voting.

1)The most annoying feature is that the (on-screen) notification cannot be switched off during trading. I mean the notification that appears at the bottom line on the screen every time you postpone take-profit or stop-loss. or when you close a position.
every time this notification appears at the bottom of the screen it does not disappear for at least 5-6 seconds minimum. and you can't see what's going on and worse is that there's nothing you can do on the screen because the notification is covering verytime the part of the scrren. worst of all is that you can't even swipe it away or do anything like that. beside that annoys a lot it is very dangerous when you are a very short-term trader. it would be best if it could simply deactivated like on the desktop version of ctrader. please please please... that would be wonderful.

thank you

0

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.

No uploaded.

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.
following bot
  17
  0
  369
by al-n
free  03 Aug 2022
this is just a simple bot that opens trades buy/sell and trails with sl in endles loop.
following bot
  6
  0
  214
by al-n
free  03 Aug 2022
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class TrailingStopLossSample : Robot { [Parameter("VolumeInLots", DefaultValue = 1)] public double VolumeInLots { get; set; } [Parameter("Buy")] public bool Buy { get; set; } [Parameter("Stop Loss", DefaultValue = 5)] public double StopLoss { get; set; } [Parameter("Trigger When Gaining", DefaultValue = 1)] public double TriggerWhenGaining { get; set; } [Parameter("Trailing Stop Loss Distance", DefaultValue = 1)] public double TrailingStopLossDistance { get; set; } [Parameter("Step (pips)", DefaultValue = 5)] public double Step { get; set; } private double _highestGain; private bool _isTrailing; protected override void OnStart() { } protected override void OnTick() { // Schaut nach ob Positionen offen sind =) if (Positions.Count == 0) { //Execute a market order based on the direction parameter ExecuteMarketOrder(Buy ? TradeType.Buy : TradeType.Sell, Symbol, VolumeInLots * 100000, "SampleTrailing", StopLoss, null); //Set the position's highest gain in pips _highestGain = Positions[0].Pips; } { var position = Positions.Find("SampleTrailing"); if (position == null) { Stop(); return; } //If the trigger is reached, the robot starts trailing if (position.Pips >= TriggerWhenGaining) { //Based on the position's direction, we calculate the new stop loss price and we modify the position if (position.TradeType == TradeType.Buy) { var newSLprice = Symbol.Ask - (Symbol.PipSize * TrailingStopLossDistance); if (newSLprice > position.StopLoss) { ModifyPosition(position, newSLprice, null); } } else { var newSLprice = Symbol.Bid + (Symbol.PipSize * TrailingStopLossDistance); if (newSLprice < position.StopLoss) { ModifyPosition(position, newSLprice, null); } } TriggerWhenGaining += Step; } } } protected override void OnStop() { // Put your deinitialization logic here } } }  
by al-n
free  25 May 2021
// this trailing stop allows you to set your steps in 0.1 pips and follows the current market price 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 my_tsl : Robot     {         [Parameter("Instance Name", DefaultValue = "")]         public string InstanceName { get; set; }         [Parameter("Include Trailing Stop", DefaultValue = true)]         public bool IncludeTrailingStop { get; set; }         [Parameter("Trailing Stop Trigger (pips)", DefaultValue = 2)]         public double TrailingStopTrigger { get; set; }         [Parameter("Trailing Stop Step (pips)", DefaultValue = 1)]         public double TrailingStopStep { get; set; }         protected override void OnStart()         {             // Put your initialization logic here         }         protected override void OnTick()         {             if (IncludeTrailingStop)             {                 SetTrailingStop();             }             // Put your core logic here         }         private void SetTrailingStop()         {             var sellPositions = Positions.FindAll(InstanceName, Symbol, TradeType.Sell);             foreach (Position position in sellPositions)             {                 double distance = position.EntryPrice - Symbol.Ask;                 if (distance < TrailingStopTrigger * Symbol.PipSize)                     continue;                 double newStopLossPrice = Symbol.Ask + TrailingStopStep * Symbol.PipSize;                 if (position.StopLoss == null || newStopLossPrice < position.StopLoss)                 {                     ModifyPosition(position, newStopLossPrice, position.TakeProfit);                 }             }             var buyPositions = Positions.FindAll(InstanceName, Symbol, TradeType.Buy);             foreach (Position position in buyPositions)             {                 double distance = Symbol.Bid - position.EntryPrice;                 if (distance < TrailingStopTrigger * Symbol.PipSize)                     continue;                 double newStopLossPrice = Symbol.Bid - TrailingStopStep * Symbol.PipSize;                 if (position.StopLoss == null || newStopLossPrice > position.StopLoss)                 {                     ModifyPosition(position, newStopLossPrice, position.TakeProfit);                 }             }         }         protected override void OnStop()         {             // Put your deinitialization logic here         }     } }