PanagiotisCharalampous's avatar
PanagiotisCharalampous
26 follower(s) 0 following 1006 subscription(s)
Replies

PanagiotisCharalampous
20 Oct 2017, 16:20

Hi amsman,

Apologies, i thought you just wanted to resolve the build errors. See below a properly working Parabolic SAR custom indicator

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.EAustraliaStandardTime, AccessRights = AccessRights.None)]
    public class ParabolicSAR : Indicator
    {
        [Parameter("Min AF", DefaultValue = 0.02, MinValue = 0)]
        public double minaf { get; set; }

        [Parameter("Max AF", DefaultValue = 0.2, MinValue = 0)]
        public double maxaf { get; set; }

        public API.Indicators.ParabolicSAR _parabolic { get; set; }

        [Output("PSAR", PlotType = PlotType.Points, Color = Colors.White, Thickness = 3)]
        public IndicatorDataSeries Result { get; set; }

        protected override void Initialize()
        {
            _parabolic = Indicators.ParabolicSAR(minaf, maxaf);
        }
        public override void Calculate(int index)
        {
            Result[index] = _parabolic.Result[index];
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Oct 2017, 12:33

Hi hungtonydang,

Positions.FindAll() does not return null. It returns an array. See documentation here. Maybe it is better to hire a professional programmer to help you with this.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Oct 2017, 12:19

Hi amsman,

The reason you cannot build your indicator is that you define _parabolic twice and you do not use the correct type in your indicator declaration. See a corrected version below

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.EAustraliaStandardTime, AccessRights = AccessRights.None)]
    public class ParabolicSAR : Indicator
    {
        [Parameter("Min AF", DefaultValue = 0.02, MinValue = 0)]
        public double minaf { get; set; }

        [Parameter("Max AF", DefaultValue = 0.2, MinValue = 0)]
        public double maxaf { get; set; }

        [Output("PSAR", PlotType = PlotType.Points, Color = Colors.White, Thickness = 3)]
        public API.Indicators.ParabolicSAR _parabolic { get; set; }

        protected override void Initialize()
        {
            _parabolic = Indicators.ParabolicSAR(minaf, maxaf);
        }
        public override void Calculate(int index)
        {
            double parabolic = _parabolic.Result[index];
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Oct 2017, 10:33

Hi dordkash@gmail.com,

Oil symbols are not available in the Spotware Demo application. If you want to see oil prices in cTrader, you could download cTrader from a broker that offers oil.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Oct 2017, 09:30

Hi dordkash@gmail.com,

Symbol names vary ber broker. It would be better to advise with your broker about the name of oil symbol in the broker's cTrader.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Oct 2017, 10:24

Hi mto1995,

You can access the cBot's time through the Time property.

/api/reference/internals/algo/time

Let me know if this is what you were looking for.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
19 Oct 2017, 09:46

Hi phernandophelix,

These icons appear when you move your mouse on top of the chart. If you move your mouse away, they will disappear.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Oct 2017, 17:20

Hi Sonar Trades,

I am not aware of something but it should be a pretty simple cBot to be implemented. You could contact our Consultants for help or post a job in the Jobs section.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Oct 2017, 15:36

Hi frapetim,

Currently there is no easy way in cAlgo to know if a position was closed because a stop loss was triggered. You will need to write custom code yourself to track this. You can add a suggestion in the Suggestions section of the forum for the product team to consider.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Oct 2017, 15:14

Hi stevenedit@gmail.com,

You can find out what these buttons do in the Chart Trading section of our help files. Check the Positions section.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Oct 2017, 09:28

Hi jjpark78,

You could use a limit order with the current price as Price. If there is available liquidity at that price, the order will be executed. If not, it will be rejected. Limit orders do not have slippage.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Oct 2017, 09:23

Hi Sonar Trades,

You cannot merge positions in cTrader. You will need to close them one by one. You could automate the process by writing a cBot that will close the positions for you as soon as a price has been reached.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Oct 2017, 17:29

Hi Alex, 

Providing a simple FIX application or cBot will bot do anything since they will both link to the same source of data which is you guys. 

It would help a lot because, as you said, it will isolate the issue to a single source of data and it would allow us to look at the issue on a common ground. Investigating the reason an application we have not seen receives different prices than a provided excel sheet of price data from an unknown price feed, is like searching a needle in a haystack. The problem could even lie in the application itself (e.g. you might be comparing data from different servers, demo and live), something we will not be able to spot in case we don't have this application. We are not disputing that you face this issue, we are just trying to narrow down the possible causes, and since you can help us reproduce it, we would really appreciate any assistance on this. If we manage to narrow it down to a single account and a single price feed but different platforms (FIX and cTrader) then it will help finding from where does this discrepancy come from.

In any case, we will try to investigate it and see if we can reach to any conclusion. We will keep you updated.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Oct 2017, 16:18

Hi Alex,

I can reassure you that it is not a case of shifting around the responsibility. We are just trying to exclude the most obvious reasons that could cause this since this does not seem to be a problem easily reproducible and noticeable. I was not aware that they redirected you to us. But comparing the price feed that is streamed via FIX with an excel sheet of prices that we don't know from where it came from and how it was generated, does not help us a lot. If you see prices updating in cTrader but not streamed through FIX then this could be something we could get hold on to and invesigate further. Would it be possible for you to provide a simple FIX application and a cBot that log prices from FIX and cTrader respectively and demonstrate the discrepancy? That would help a lot.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Oct 2017, 15:42

Hi Alex,

Yes now it is clear. There are many possible reasons that this can happen. One of them is that you are comparing price data from different sources. Have you asked them if the data provided comes from the same feed as cTrader prices? Another reason could be that they might apply some kind of throttling on their price feed (e.g. 5 prices per second) for performance reasons. We stream through our APIs whatever we receive from their price feeds. I would suggest to contact them as well and ask for their advice. If the reason is not one of the above we can investigate further.

Best Regards.

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Oct 2017, 15:06

Hi Alex,

It is still not clear to me

"price feed from FIX API"

does this come from an IC Markers account?

 Price Feed from IC Markets

From which channel does this price feed come from? FIX, Connect, cAlgo, other?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Oct 2017, 14:33

Hi ycomp,

Our request limit has been updated to 30 req/min so probably that is not the reason. Please check if you are exceeding this limit in any way.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Oct 2017, 14:31

Hi Alex,

It is not clear what you are actually comparing. Do you compare price updates via FIX between two different accounts (Spotware account vs IC Markets) or do you compare price updates for the same account via two different platforms (FIX API vs cTrader)?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Oct 2017, 10:38

Hi Yurii,

In principle yes this is possible, either by using Connect API or FIX API. You start by having a look at our example projects here and here which are written in C# allowing you to "borrow" some code for your cBot.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Oct 2017, 09:49

Hi frapetim,

Thanks for posting in our forum. What exactly do you need to check? That the position was closed in general or that it was closed because SL was triggered?

Best Regards,

Panagiotis


@PanagiotisCharalampous