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

PanagiotisCharalampous
09 Oct 2017, 14:24

Hi ycomp,

This is not possible in cTrader. Charts are always drawn based on the Ask price. If you would like to see such a feature in cTrader, you can post a suggestion in the Suggestions section.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
09 Oct 2017, 14:21 ( Updated at: 21 Dec 2023, 09:20 )

Hi Paul,

The behavior is correct. ChikouSpan is a line that plots recent prices n periods ago. On current bar it's value is NaN. See below

In order to get the last ChikuSpan value, you need to use the following code.

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 IchimokuKinkoHyoTest : Robot
    {
        IchimokuKinkoHyo ihk;

        protected override void OnStart()
        {
            ihk = Indicators.IchimokuKinkoHyo(9, 26, 32);
        }

        protected override void OnBar()
        {
            var index = MarketSeries.Close.Count - 1;
            Print(ihk.TenkanSen[index]);
            Print(ihk.KijunSen[index]);
            Print(ihk.SenkouSpanA[index]);
            Print(ihk.SenkouSpanB[index]);          
            Print(ihk.ChikouSpan[index - 26]);
        }

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

Hope this helps.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
09 Oct 2017, 11:11

Hi croucrou,

Could you please explain, what does it mean exactly. Will it be possible to modify volume of a position during backtesting?

Yes you should be able to do that.

 Are you able to say when could the update be possibly expected?

We do not have a release date yet but we are testing this feature so it should be out soon.

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
09 Oct 2017, 10:41

Ηι Paul,

What made you conclude that the ChikouSpan value is wrong? Do you have any expected vs real values? Could we have a fully working example of the export to check that? This information would make it easier for us to assist you.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
09 Oct 2017, 09:29

Hi danblackadder,

Yes it is in our plans to implement this feature but we still don't know when this will be released.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
09 Oct 2017, 09:21

Hi obaum1@gmail.com,

when the target price is triggered now I have two running positions 

This is not true. If you use tag 721, your order will pe placed to the specified position, hence in this case it will close the position instead of opening a new one.

Each  trade commission is around 0.08 -> so I payed 0.16 in commission because I opened two positions.

If I open my position via Connect API I can set TakeProfit & StopLoss and the position will "close it self" and I paid 0.08

Commissions are per side (open/close). You will pay 0.08 when you open a position and 0.08 when you close a position. So in both cases you will pay 0.16. 

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Oct 2017, 09:26

Hi obaum1@gmail.com,

Can you please clarify what do you mean when you say that you have two positions? When you enter the marker with your market order at 1.17852, a position is created. Which is the second one? 

Also why do you say that commissions are higher?

In general the steps of your example are correct. You should also remember when an SL/TP order is executed to cancel the other one.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Oct 2017, 09:18

Hi Alex,

Correct :)

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Oct 2017, 09:16

Hi obaum1@gmail.com,

I would advise you to put the stream.Read() function in a while loop and continue reading the stream until the function returns 0, which is the number of bytes read.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Oct 2017, 17:58

Dear leohermoso,

There could be many reasons that this happens e.g. are the backtesting parameters exactly the same as your broker's settings? In order to explain the difference we will need to have the cBot code and the exact backtesting parameters so that we can reproduce internally and check deals one by one.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
05 Oct 2017, 16:19

Hi obaum1@gmail.com,

It is not a normal behavior. Are you sure that the messages are indeed returned truncated? The issue could be caused by the way you are reading and parsing the messages. Can you reproduce this using the example project?

Best Regards,

Panagiotis
 


@PanagiotisCharalampous

PanagiotisCharalampous
05 Oct 2017, 14:11

Dear Forex Trader,

Commissions are not transferred to your balance instantly but at the end of the day.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
05 Oct 2017, 12:54

Hi k_baghyan,

This is a known issue in cAlgo and should be fixed in the next major release.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Oct 2017, 09:45

Hi hungtonydang,

The correct syntax for the foreach loop is the following

foreach (var position in Positions.Find(label))
{
.
.
.
.
}

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

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Oct 2017, 09:41

Hi hungtonydang,

If you know the exact time of the hour you are after then you can specify it as shown below

MarketSeries.OpenTime.GetIndexByExactTime(new DateTime(2017,10,5,10,0,0))

The sample above returns the value for X hours (if you are on the h1 timeframe) before the current time.

Let me know if this helps.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Oct 2017, 09:23

Dear leohermoso,

This is a similar issue with the one in this discussion. Please read my last reply which explains why this is happening. The cAlgo team is looking at this issue.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Oct 2017, 09:19

Hi Depesh,

There isn't a release date for this feature yet. However it is in the last stages of development so it should come out soon.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Oct 2017, 09:16

Hi obaum1@gmail.com,

It could happen but this is a very rare case. However, in any case you detect a truncated message and you need the server to send it again, there is a Resend Request in the FIX API Rules of Engagement.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
04 Oct 2017, 10:43

Dear dordkash@gmail.com,

We are happy that you found a solution to your problem. Thanks for sharing the solution as well! It will be useful for other cTrader users that experience the same issue.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
04 Oct 2017, 09:22

Hi meta4charting@gmail.com,

Thanks for posting in our forum. Can you please share the cBot code so that we can advise what the problem could be?

Best Regards,

Panagiotis


@PanagiotisCharalampous