Replies

PanagiotisCharalampous
08 Aug 2019, 17:43

Hi Chris,

Yes send it at community@spotware.com

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 17:31

Hi furko.zoltan1989,

If you run the same code in all instances, then all instances will stop. The solution would be to filter the positions by instance and stop the cBot only if the opened position has been opened by the specific instance. You can use the position label for this puprose and have a different label for each instance. Then on OnPositionsOpened check if the position has the instance's label and act accordingly.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 17:09

Hi Chris,

You should not stop receiving data. To investigate further please send us the following information

  • Account Number
  • Broker 
  • Proxy
  • The exact time you subscribe to market data and the FIX message you send.
  • The exact time the stream stops.

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 17:06

Hi derangedlol,

Can you record a short video demostrating this problem?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 16:22

Hi FireMyst,

We have investigated this issue further

  1. The message seems to appear because you have instances with different workspaces running. When connection is lost and then restored then cTrader attempts to load the last used workspace, therefore tries to change the workspace for one of the instances. Thus you get the message. This behavior will change in 3.6
  2. We could not reproduce performance issues. As far as we can tell you are using several custom cBots/indicators which could be the cause of the problem. To investigate further we will need all the custom indicators and cBots running as well as your settings file

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 15:22 ( Updated at: 21 Dec 2023, 09:21 )

Hi chanapong3,

stopLossTriggerMethod refers to the method used to trigger a stop loss. It corresponds to the method found in the UI below

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 14:41

Hi chanapong3,

Thanks for posting in our forum. To enable trailing stop loss of a position just set the relevant parameter of ExecuteMarketOrder to true. If you want to enable trailing stop loss for an existing position, use ModifyTrailingStopLoss.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 13:51 ( Updated at: 21 Dec 2023, 09:21 )

Hi tazotodua,

See below

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 10:34

Hi ancdriver239,

You can also consider a simple cBot. The functionality you see above is available only in the legacy mobile application.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 10:23

Hi ancdriver239,

It will close all the positions of the account.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 09:41

Hi apollinaire89

See below a modified example.

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 SampleRSIcBot : Robot
    {
        [Parameter("Quantity (Lots)", Group = "Volume", DefaultValue = 1, MinValue = 0.01, Step = 0.01)]
        public double Quantity { get; set; }

        [Parameter("Source", Group = "RSI")]
        public DataSeries Source { get; set; }

        [Parameter("Periods", Group = "RSI", DefaultValue = 14)]
        public int Periods { get; set; }

        [Parameter("Stop Loss Pips", Group = "Protection", DefaultValue = 0.0, MinValue = 0.0, Step = 1)]
        public double StopLossPips { get; set; }

        [Parameter("Take Profit Pips", Group = "Protection", DefaultValue = 0.0, MinValue = 0.0, Step = 1)]
        public double TakeProfitPips { get; set; }

        private RelativeStrengthIndex rsi;

        protected override void OnStart()
        {
            rsi = Indicators.RelativeStrengthIndex(Source, Periods);
            Positions.Opened += OnPositionsOpened;
        }

        void OnPositionsOpened(PositionOpenedEventArgs obj)
        {
            Notifications.SendEmail("youremail@address.com", "youremail@address.com", "MyRSISell", "position opened");
        }

        protected override void OnTick()
        {
            if (rsi.Result.LastValue < 62)
            {
                Close(TradeType.Buy);
                Open(TradeType.Sell);
            }
        }

        private void Close(TradeType tradeType)
        {
            foreach (var position in Positions.FindAll("SampleRSI", SymbolName, tradeType))
                ClosePosition(position);
        }

        private void Open(TradeType tradeType)
        {
            var position = Positions.Find("SampleRSI", SymbolName, tradeType);
            var volumeInUnits = Symbol.QuantityToVolumeInUnits(Quantity);

            if (position == null)
                ExecuteMarketOrder(tradeType, SymbolName, volumeInUnits, "SampleRSI");
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 09:31

Hi ancdriver239,

No it does not work the same way on desktop. On desktop you have the option to have the button clicked on a) Single Click b) Double Click c) Completely Disabled. You also have the option to receive a warning before closing all positions.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 09:25

Hi apollinaire89,

It seems correct to me, assuming that the rest of the cBot is correctly implemented.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2019, 09:20

Hi apollinaire89,

Thanks for posting in our forum. Did you have any problems with the code you posted. I presume that it is only a part of the code of the cBot.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Aug 2019, 17:21

Hi Vykuk,

Thanks for posting in our forum. It is the same issue discussed here.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Aug 2019, 14:57

Hi Darren,

We do not have an ETA yet but should be in the following weeks.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Aug 2019, 14:52

Hi Darren,

Probably in the next major update of cTrader.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Aug 2019, 14:27

Hi Darren,

If you play around with the time label you should get the scroll bar. In any case, this will be solved in an uncoming update of cTrader.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Aug 2019, 12:36 ( Updated at: 21 Dec 2023, 09:21 )

Hi Darren,

If you drag the time label to the middle you should get the scroll bar below the chart. Then you should be able to scroll back as much as you want. See below

Hope this helps.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
07 Aug 2019, 12:23

Hi Darren,

Can you explain what do you mean? cTrader loads more tick data as you scroll back in time.

Best Regards,

Panagiotis


@PanagiotisCharalampous