Replies

PanagiotisCharalampous
20 Dec 2018, 09:30

Hi Pep,

Here it is

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 NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        protected override void OnStart()
        {
            Chart.ObjectAdded += OnChartObjectAdded;
        }

        void OnChartObjectAdded(ChartObjectAddedEventArgs obj)
        {
            if (obj.ChartObject is ChartHorizontalLine)
                Print("Object Added: " + (obj.ChartObject as ChartHorizontalLine).Y);
        }

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

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Dec 2018, 14:12

Hi Marcio,

Thanks for your post but even after translation it is not clear what are you trying to convey to us. Any change you can post it in English?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Dec 2018, 09:51

Hi tgjobscv,

Which browser do you use? Can you please try a different one?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Dec 2018, 09:40

RE:

damian8 said:

Hi Panagiotis, I seem to hit 1000MB RAM usage within an hour or so of trading. My workspace has two tick charts, several indicators on each. And a daily chart.

It seems that once I get to appox 1000MB, cTrader slows right down and I have to restart. I have 8gb memory, and my PC tends to operate using about 50% of that.

Hi dmn,

Do you use custom indicators or built in ones? If you use custom indicators can you send them to me? I will need to have your exact setup in order to say if this is an issue or not.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Dec 2018, 12:53

Hi Ton,

I am not sure what do you mean with "flaw" and "simulate h2 in Backtesting". There is no flaw here and nothing to simulate. If you use tick data in backtesting then you will get an accurate backtest result no matter if you are using OnTick(), OnBar() or both. If you use h2 (open prices) you will not get an accurate backtesting result in case you are using OnTick(). It only uses bar open prices and it is suitable for cBots using only OnBar(). But it saves time in data downloading backtesting execution and optimization.

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
18 Dec 2018, 12:40 ( Updated at: 21 Dec 2023, 09:21 )

Hi robert.dms83@gmail.com,

Renko charts are available on ICMarkets Desktop. See below

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Dec 2018, 11:37

Hi dmn,

If you made it to this stage, you are already signed in using your cTID. If you do not see your trading accounts here, you need to contact your broker to link them with your cTID. Please make sure you are using your broker's cTrader.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Dec 2018, 11:12

Hi Ton,

There is no problem in using them both in a cBot. The problem is using OnTick() and backetesting with data that will not trigger OnTick() properly. If you use OnTick() in your cBot but backtest using h2 (open prices) then you will be getting the same Symbol.Bid and Symbol.Ask price for every tick until the bar changes. This will result to wrong backtesting result.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Dec 2018, 10:29

Hi apple0918528461,

This is the convention used in OTC markets like CFD trading. Since there is no central avenue for trading, like an exchange, we cannot know what are the last deals that took place.

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
18 Dec 2018, 10:20

Hi dmn,

Where do you get this message? You should get the login screen as soon as you launch the application.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Dec 2018, 09:50

Hi thegreat.super,

Unfortunately we cannot release any API code.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Dec 2018, 09:47

Hi robert.dms83@gmail.com,

Thank for posting your suggestion. Renko bars are available in cTrader 3.3. Which broker's cTrader do you use?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Dec 2018, 09:39

Hi Ben,

Thank you for posting in our forum and for sharing yor suggestion. Please note that cTrader Automate API features its own Timer class which works in backtesting as well.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Dec 2018, 09:31

Hi 1001camel,

I am happy that the issue has been resolved. Let us know if anything else occurs.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Dec 2018, 16:59

Hi vancong140293,

Can you post the full cBot code to check it?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Dec 2018, 16:18

Hi vancong140293,

Try changing your condition to the following

if (Symbol.Ask == targetprice + 0.02 && Positions.Find(label, Symbol, TradeType.Sell) == null)

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Dec 2018, 15:15

Hi 1001camel,

We cannot detect any problems on the specific proxy. You can use WinMTR to run some network diagnostics. If the connection is fine, then probably there is some other issue with cTrader or your computer. In this case, please send us some troubleshooting information by pressing Ctrl+Alt+Shift+T, pasting the link to this discussion in the text box and pressing submit.

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Dec 2018, 12:42

Hi Mario,

The way stop limit is implemented in cTrader is in fact a market range order triggered when the stop price is reached. So if you send a market order with range, it will behave in the same way as it would if it was a stop limit order that was just triggered.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Dec 2018, 12:36

Hi oliveira.phc,

MarketData.GetSeries(Timeframe) should work fine for tick data, as long as you set the timeframe from the interface. We just need to update the Timeframe class. We will do this in one of he upcoming updates.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Dec 2018, 11:48

Hi Ton,

The problem is with your backtesting data, not with the event hanlders. If you want to backtest a cBot with logic in OnTick(), then you should be using tick data and not h2 (open prices).

Best Regards,

Panagiotis


@PanagiotisCharalampous