Topics
16 Nov 2023, 07:42
 1170
 1
15 Nov 2023, 10:36
 2069
 16
Replies

Spotware
28 Aug 2017, 09:36

Dear irmscher9,

MarketSeries.Low is a property with a type of DataSeries which contains a list of values. The index gets the value in the dataseries at the specified position. See an example here.

Best Regards,

cTrader Team


@Spotware

Spotware
27 Aug 2017, 12:44

Dear michaelstefans,

You might also want to post your job in the Jobs page. It will make it easier for professional consultants to see you post and contact you.

Best Regards,

cTrader Team


@Spotware

Spotware
27 Aug 2017, 12:41

Dear slodder04,

Check here how access an indicator from a cBot.

Regarding the index of the candle, the last candle has index 0. See following code sample on how to get the last High value from MarketSeries

var lastHighValue =  MarketSeries.High.Last(0);

Best Regards,

cTrader Team


@Spotware

Spotware
27 Aug 2017, 12:35

Dear Trader,

During weekends, maintenance is taking place on cTrader platforms and occasionally some services might become unavailable. Can you please check again and let us know if you still experience the problem?

Best Regards,

cTrader Team


@Spotware

Spotware
25 Aug 2017, 12:51

Dear Traders,

The issue with ICMarkets has been resolved. Can you please try now?

Best Regards,

cTrader Team


@Spotware

Spotware
25 Aug 2017, 10:31

Dear yosifov,

You can use labels to distinguish between different position types. For example, when opening a position from a cBot, you can apply a label as follows

ExecuteMarketOrder(TradeType.Buy,Symbol,1000,"MyLabel");

and then when you are modifying these positions you can filter your positions using the label. See below

foreach(var position in Positions.Find("MyLabel"))
{
 // Modify/Close positions
}

Let us know if this helps.

Best Regards,

cTrader Team


@Spotware

Spotware
25 Aug 2017, 10:24

Dear deltrader.pt@gmail.com,

Currently ExecuteMarketOrder() takes stop loss and take profit only in pips.

Best Regards,

cTrader Team 


@Spotware

Spotware
25 Aug 2017, 10:09

Dear croucrou,

Can you please tell us your broker so we can investigate?

Best Regards,

cTrader Team


@Spotware

Spotware
24 Aug 2017, 12:39

Dear Trader,

It is not possible to move positions between accounts.

Best Regards,

cTrader Team


@Spotware

Spotware
24 Aug 2017, 11:46

Dear hungtonydang,

It would be easier for somebody to help you if you provide some additional information. If possible please provide us with the following

1) The complete code for the cBot. 

2) What values do you receive.

3) What would you expect to receive.

From what we can deduce from your code sample, you are using the value of the main line of a Bollinger Band. If this is the case, then it is not uncommon this value to be near the market price.

Best Regards,

cTrader Team


@Spotware

Spotware
24 Aug 2017, 10:42

Dear Trader,

This information is not available in cAlgo.API. It is something you need to calculate yourself.

Best Regards,

cTrader Team


@Spotware

Spotware
23 Aug 2017, 09:40

Dear deltrader.pt@gmail.com,

It seems that your take profit/stop loss parameters are passed as absolute prices rather than in pips. Can you please check this?

Best Regards,

cTrader Team


@Spotware

Spotware
23 Aug 2017, 09:16

Dear tradingu,

This information is available in the deal information form but currently it is not exportable in cTrader. 

Best Regards,

cTrader Team


@Spotware

Spotware
22 Aug 2017, 14:52

Dear rayscluster,

Thanks for posting your issue and your suggestion for resolving it. We will forward it to cTrader's product team for consideration. 

Best Regards,

cTrader Team


@Spotware

Spotware
22 Aug 2017, 14:47

Dear swingfish,

An easy way to achieve this is to construct an ideal trendline in your cBot and check the price on each tick. See below an example of creating such a trendline and getting the price in the OnTick() function. You need to put your trendline's chart coordinates (start price, start time, end price, end time) and the current price is printed in the cBot's log on each tick

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 TrendlinecBot : Robot
    {
        private double _startPrice;
        private double _endPrice;
        private double _slope;
        private DateTime _startDate;
        private DateTime _endDate;
        protected override void OnStart()
        {
            _startPrice = 1.15;
            _endPrice = 1.2;
            _startDate = DateTime.Now;
            _endDate = DateTime.Now.AddHours(1);
            TimeSpan diff = (_endDate - _startDate);
            _slope = (_endPrice - _startPrice) / diff.TotalSeconds;
        }

        protected override void OnTick()
        {
            TimeSpan diff = (DateTime.Now - _startDate);
            var trendlinePrice = _slope * diff.TotalSeconds + _startPrice;
            Print(trendlinePrice);
        }

        protected override void OnStop()
        {

        }
    }
}

Let us know if this solution helps you,

Best Regards,

cTrader Team


@Spotware

Spotware
22 Aug 2017, 14:08

Dear trend_meanreversion,

Please check the following resource. It could be helpful for what you are trying to achieve

https://code.msdn.microsoft.com/windowsdesktop/C-and-Python-interprocess-171378ee

Best Regards,

cTrader Team


@Spotware

Spotware
22 Aug 2017, 11:51

Dear Trader,

Thanks for posting your suggestion to the forum. We advise you to post your suggestions in the relevant Suggestions section, so that they are all gathered in one place for future reference. We will forward your suggestion to the relevant product team.

Best Regards,

cTrader Team


@Spotware

Spotware
22 Aug 2017, 11:35

Dear afhacker,

It is in our plans to move to a higher version of .Net but this will take place in a later release.

Best Regards,

cTrader Team


@Spotware

Spotware
21 Aug 2017, 16:35

Dear swingfish,

From what we understand, you need to get the current value of an indicator. Please see the following example that prints the value of the Simple Moving Average indicator on each tick

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

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

        private SampleSMA sma;

        protected override void OnStart()
        {
            sma = Indicators.GetIndicator<SampleSMA>(Source, SmaPeriod);
        }

        protected override void OnTick()
        {
            Print("{0}", sma.Result.LastValue);
        }
    }
}

Let us know if the above helps or if you meant something different.

Best Regards,

cTrader Team


@Spotware

Spotware
21 Aug 2017, 16:30

Dear tradermatrix,

Could you please explain what do you mean by saying "manually pass an order"? Currently you can create an order from the interface or using cAlgo. Do you have any other way in mind? Regarding manually applying a label to an order, we don't have such plans currently. 

This would make it possible to differentiate the various strategies or to correct a bug on a robot by adding commands with the same label

Why not to fix the bug in the first place? If you can explain a bit more the necessity of this feature, then we can consider it for future releases.

Best Regards,

cTrader Team 


@Spotware