Replies

PanagiotisCharalampous
13 Aug 2018, 10:13

Dear Trader,

Thanks for posting in our forum. However, it is not very clear what the problem is. Could you please give us a more detailed description?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
13 Aug 2018, 10:08

Hi thongbaogiaodich,

No tick should be missed. OnTick() should be executed for every incoming tick. The only side effect you should worry about is that the code for some ticks might be executed with some delay.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
13 Aug 2018, 10:04

Hi nguyenbaocuong,

Time difference between placing orders is natural and expected as there is processing time involved. You cannot expect instant order placement in a live environment. Backtesting is just a simulation, there is no trading taking place, there is communication with the server, neither time progression can be simulated in millisecond accuracy, therefore processing time might not be represented accurately. 

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
13 Aug 2018, 09:52

Hi DelTrader,

Can you please post a complete cBot code?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
13 Aug 2018, 09:44

Hi all,

Please try this link.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
13 Aug 2018, 09:40

Hi pablocg74,

If you wish to delete your demo accounts, you need to contact your broker/s and ask them to delete them for you.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
10 Aug 2018, 16:51

Hi Lavio,

1) The reason that I am asking for the cBots is to be able to reproduce this on my local computer so that the team can find out why this happens. You presume that the reason is the integration but I am pretty sure this is not the problem. If you don't want to share your robot publicly, send it to me at community@spotware.com.

2) cTrader Trade charts and cTrader Automate charts do not affect each other. So if you use cTrader Trade on one instance and cTrader Automate on another, no mixup will happen. It will be exactly like running cTrader and cAlgo in parallel.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
10 Aug 2018, 16:03

Hi Lavio,

1) I still do not understand why you cannot run two instances of cTrader, one for trading and one for developing. I trade and write robots myself and I do not see any problem doing that. It is exactly the same thing as running two different applications. 

2) For cTrader to stop responding, then probably the application is overloaded, mostly because of the robots running at that time. In order to help you further with this, I will need the cBots code.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
10 Aug 2018, 11:33 ( Updated at: 21 Dec 2023, 09:20 )

Hi Patrick,

I see that only the last separator is missing. But when I try to reproduce your set up, I see no problems. See below


Can you try changing period separators color and let me know if the separator appears? It could be a rendering issue on your side.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
10 Aug 2018, 09:39

Hi bishbashbosh,

Your cBot places stop limit orders after the green dot. The stop limit orders will be executed when the target price is reached. This might happen some bars after the green dot. If there is a position that you cannot understand why it is there, you can send me backtesting parameters and a trade that you think is wrong and I will explain you why it is placed. 

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
10 Aug 2018, 09:20

Hi Alex,

See below the modified code that trades between 7 and 10 am.

// -------------------------------------------------------------------------------------------------
//
//    This code is a cAlgo API sample.
//
//    This cBot is intended to be used as a sample and does not guarantee any particular outcome or
//    profit of any kind. Use it at your own risk.
//
//    The "Sample RSI cBot" will create a buy order when the Relative Strength Index indicator crosses the  level 30, 
//    and a Sell order when the RSI indicator crosses the level 70. The order is closed be either a Stop Loss, defined in 
//    the "Stop Loss" parameter, or by the opposite RSI crossing signal (buy orders close when RSI crosses the 70 level 
//    and sell orders are closed when RSI crosses the 30 level). 
//
//    The cBot can generate only one Buy or Sell order at any given time.
//
// -------------------------------------------------------------------------------------------------

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("Source")]
        public DataSeries Source { get; set; }

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

        [Parameter("Quantity (Lots)", DefaultValue = 1, MinValue = 0.01, Step = 0.01)]
        public double Quantity { get; set; }

        private RelativeStrengthIndex rsi;

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

        protected override void OnTick()
        {
            if (Server.Time.Hour >= 7 && Server.Time.Hour < 10)
            {
                if (rsi.Result.LastValue < 30)
                {
                    Close(TradeType.Sell);
                    Open(TradeType.Buy);
                }
                else if (rsi.Result.LastValue > 70)
                {
                    Close(TradeType.Buy);
                    Open(TradeType.Sell);
                }
            }
        }

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

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

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

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
09 Aug 2018, 15:42

Dear Trader,

Thanks for posting in our forum and bringing this into our attention. It seems to be a bug, we will fix it in one of the following updates.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
09 Aug 2018, 14:12

Hi Alex,

If you share your code, we might be able to make some suggestions.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
09 Aug 2018, 12:25

Hi Patrick, 

I don't understand what is the problem. I can see them.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
09 Aug 2018, 09:56

Hi bishbashbosh,

I had a look at the cBot and indicator but I cannot see any issue. Can you please explain to me why you think the output is garbage? What does the cBot do and what would you expect it to do instead?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
09 Aug 2018, 09:30

Hi Alex,

Thanks for posting in our forum. However it is not clear what kind of advice do you need. Could you please explain further?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2018, 14:23

Hi Lavio,

Can you share your robots and setup so that we can test it? Also please let us know about your computer's specs.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2018, 12:08

Hi dicairo.bassem,

You lose your followers because you change your pricing policy. Therefore, you will need to get their explicit approval for the new prices. You cannot change your pricing without them being notified and accepting the new price.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2018, 10:47

Hi bishbashbosh,

Thank you for posting in our forum. Could you please send us the full source code of the cBot and indicator so that we can reproduce and advise accordingly?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
08 Aug 2018, 10:39

Hi robotic,

.pdb files are not needed. What you debug is the cBot and not cTrader. If you follow the instructions you should have no problem setting breakpoints.

Best Regards,

Panagiotis


@PanagiotisCharalampous