Replies

Marin0ss
24 Jun 2022, 09:25

RE: RE: RE:

firemyst said:

Marin0ss said:

So another solution which would work for me is a snippet of code that stops the robot after the last 5 trades closed negative.

 

Here's a snippet to help you get started.

This assumes you've created an event method when a position is closed called "Positions_Closed":

 

private void Positions_Closed(PositionClosedEventArgs args)
{
	Position p1 = args.Position;
//in case there are multiple, you can narrow it down by symbol name and label
	if (p1.SymbolName == Symbol.Name && p1.Label == _positionLabel)
	{
		//Consecutive Losing Trades
		if (p1.NetProfit < 0)
			_numberOfConsecutiveLosingTrades += 1;
		else
			_numberOfConsecutiveLosingTrades = 0;
	}
//
// blah blah blah with other stuff you may need to do
//
// then stop the bot if it's greater than your threshold
    if (_numberOfConsecutiveLosingTrades >= 5)
        Stop();
}

 

Thanks a lot!! Got it working.


@Marin0ss

Marin0ss
23 Jun 2022, 22:13

RE:

So another solution which would work for me is a snippet of code that stops the robot after the last 5 trades closed negative.

 


@Marin0ss

Marin0ss
05 May 2022, 12:33

RE:

PanagiotisCharalampous said:

Hi both,

Thanks, our teams are investigating this.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Renko charts are loading again


@Marin0ss

Marin0ss
02 May 2022, 15:20

RE: RE:

PanagiotisCharalampous said:

Hi there,

Can you please provide more info about your problem? Could you share a short video demonstrating the problem? We will also need to know your broker and your account number.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

 

Same here; I am using ICMarkets. When starting the client (on laptop) Renko charts are not loading. (Loading icon keeps spinning, also when changing Renko size).

The client on my VPS which is off course running continously is still printing the Bars, but I assume will stop working once I restart the application.


@Marin0ss

Marin0ss
29 Jan 2022, 14:43 ( Updated at: 29 Jan 2022, 15:47 )

RE: RE: Refer price/indicator values on different Range chart

cW22Trader said:

Marin0ss said:

Hi Ctrader team,

Is it possible to refer to Open/Close/High/Low values & Indicator results from a different Range Bar chart?

Like running Ra100 Chart while getting values from Ra500 for example, just like referring values in a higher TF?

If not yet possible; any plans to implement this already?

Thanks in advance!

I think this is possible at least with Renko. This should be the same with Range bars.

But be carefull when using OHLC data of "higher" or larger TF. On historical data of e.g. on a chart it will use future data of the higher TF. E.g. a Ra100 bar just closed and your indicator algo gets triggered and you also get the data from the Ra500 bar using this API "Ra500bar.OpenTimes.GetIndexByTime(Ra100bar.OpenTimes[index])". The Ra500 bar may not be closed yet but since on historical data you only have access to completed OHLC data, you would use future data of that Ra500 bar which produces unrealistic results.

@cTrader Team: please correct me if I'm wrong...

Kind regards

Thanks! Got me further. I can now get the values from a custom Indicator; but I can't seem to refer to a different RangeBar chart with the standard build in Indicators (for e.g. Supertrend).

Could you help me out a bit here?

So, the DSS values I get back correct; ST values are from the TF the Bot is running on; so that is also fine.

But When I add Ra500 to the ST500 line, like below, it fails and mentioned an overload as only wants to see 2 arguments.

ST500 = Indicators.Supertrend(Ra500, 10, 3.0);

(If I change the indicator to for example a Moving Average like: ST500 = Indicators.MovingAverage(Ra500.ClosePrices, 10, MovingAverageType.Exponential);, no error messages displayed. So seems issue with Supertrend, or I misconfigure it..)

I also got it working if I download the custom Supertrend indicator that can be found in the Algorithms section, but I rather use the standard one located in cTrader.

Ps. I add the code to OnStart, so I can test this in the weekend, as we cannot Backtest RangeBar data..

Thanks in advance!

//#reference: ..\Indicators\DSS Bressert.algo
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 RangeBarMTFtest : Robot
    {
        private DSSBressert DSS;

        private Supertrend ST;
        private Supertrend ST500;

        private Bars Ra500;

        protected override void OnStart()
        {
            Ra500 = MarketData.GetBars(TimeFrame.Range500);

            DSS = Indicators.GetIndicator<DSSBressert>(Ra500, 13, 8, 8);

            ST = Indicators.Supertrend(10, 3.0);

            ST500 = Indicators.Supertrend(Ra500, 10, 3.0);

 


@Marin0ss

Marin0ss
28 Jan 2022, 22:18

Refer price/indicator values on different Range chart

Hi Ctrader team,

Is it possible to refer to Open/Close/High/Low values & Indicator results from a different Range Bar chart?

Like running Ra100 Chart while getting values from Ra500 for example, just like referring values in a higher TF?

If not yet possible; any plans to implement this already?

Thanks in advance!


@Marin0ss

Marin0ss
26 Apr 2019, 23:59

Thanks Sascha! :D

This helped me out very well! Got it working! As I only need it when creating it's ok, changing afterwards is indeed not possible for label.

Have a nice weekend!

 


@Marin0ss

Marin0ss
20 Jun 2018, 10:38

Hi,

Indeed, congrats to latest update; one question though, as asked before, why is 70 tick chart option missing? Has this been done on purpose? If so, what is the idea behind this?

I don't understand why all other multplies of 10 ticks are available and 70 is not??!!?

Thanks in advance for your reply!

 


@Marin0ss

Marin0ss
24 Aug 2017, 17:24

Great!! Thanks for adding this feature!


@Marin0ss

Marin0ss
17 Mar 2017, 14:07

No problem! Good luck :)


@Marin0ss

Marin0ss
17 Mar 2017, 14:03

Quite easy:

Open 4 hour chart; add Ichimoku Indicator.

Than add a second Ichimoku Indicator but change the parameters:

I assume you will be using standard settings for the 4 hour chart: Tenkan Sen = 9, Kijun Sen = 26, Senkou Span B = 52.

Daily chart consists of 6 four hour bars:

So to display the Ichimoku indicator with the values from the Daily chart add a second indicator with settings:

Tenkan Sen = 9 * 6 (54)

Kijun Sen = 26 * 6 (156)

Senkou Span B = 52 * 6 (312)

 

Good Luck!


@Marin0ss

Marin0ss
17 Mar 2017, 13:39

Well, in my believe, same as with the tickcharts limited to 34 ticks it has to do with the performance of Ctrader.

If it would be made possible, I would say the application will crash due to the fact that the application cannot handle all the data.

So this will be made possible when they will make Ctrader more faster, and hopefully also increase tickcharts, as that is really something I am waiting for!


@Marin0ss

Marin0ss
17 Mar 2017, 13:35

In the bar on the left below your account details you should have 3 tabs: Symbols, Watchlists, Cbots.

If Bar is not visible press F11 to change your layout.


@Marin0ss

Marin0ss
16 Jan 2017, 23:27

You can use the webversion of Ctrader; I believe you can choose an Heiken Ashi chart as a default charttype, than you can compare with the custom indicators to find if its accurate.


@Marin0ss

Marin0ss
16 Jan 2017, 21:23

Are you familiar with the search function on this website? :) Because there are custom indicators to be found that will bring you an Heiken Ashi chart...


@Marin0ss

Marin0ss
25 Aug 2014, 19:55

RE:

Thanks! 

 

modarkat said:

ROC.rocline.Last(0) - current value,

ROC.rocline.Last(1) - previous value

 


@Marin0ss

Marin0ss
09 Jun 2014, 16:56

RE: RE:

Hi, Thank you very much! I left out te part in OnStart, as I don't want an order to be opened. (this will not cause any problems for the rest of the code?)

I would also like to Backtest this, this is not possible because of use of Server.Time; how must the code look to make this work?

I tried to replace Server.Time for MarketSeries.OpenTime.LastValue but this won't work.

 


@Marin0ss