Replies

PanagiotisCharalampous
16 Jul 2018, 14:48

Hi Daniele,

The entry price of a position does not change if you close a part of it. If for example you open a EURUSD position of €10k at 1.10, when you close €5k it doesn't change the fact that the remaining €5k have been entered at 1.10.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Jul 2018, 14:35

Hi ceacuk,

Is there a reason that OpenTime does not work for you?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Jul 2018, 14:28

Hi Pavan,

Did you check if you get subsequent messages with quotes for the rest of the symbols? You should be getting one message per quote.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Jul 2018, 14:15

Dear Trader,

Thanks for posting in our forum. If you are looking for ADX then you will find it in Directional Movement System indicator. Regarding the source of the RSI indicator, you can always use a custom indicator as an input, which can contain the median value of each candlestick.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 17:26

See below how you can find the positions with a specific label

Positions.FindAll("label");

 


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 17:21

Not really sure what you mean... If each robot has a distinct label, you will be able to filter and close positions of specific robots.


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 16:59

Hi Alexander,

Simply controling a cBot from another cBot is not currently possible. You will need some more advanced solution which depends on the use case. We discussed this a bit here. You should develop a method of communication between cBots. For example, you could have a controler cBot that will raise flags to other cBots, when they need to shut down themselves. The flags could be set in a file, accessible by all cBots. However, each specific use case might have a different ideal solution.


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 16:44

Hi Alexander,

I assumed that you wanted to operate on open positions. What would you like to do to a robot that has no open positions? If it doesn't have a position open yet, then it does not have a P&L neither does it allocate any margin. 

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 15:58

Hi quesnayquadrato,

In the backtesting log you will see the following message

01/04/2011 00:05:00.000 | Crashed in OnTick with NullReferenceException: Object reference not set to an instance of an object.

This means that you are trying to read variables that are null. In your code, the exception is thrown in the following parts

            if (current_SD < previous_SD)
            {
                var position2 = Positions.Find("OrdineComprare");
                ClosePosition(position2);
            }
 
 
            if (current_SD < previous_SD)
            {
                var position1 = Positions.Find("OrdineVendere");
                ClosePosition(position1);
            }

Before closing a position you should always check if it is null. Modify your code as follows

            if (current_SD < previous_SD)
            {
                var position2 = Positions.Find("OrdineComprare");
                if (position2 != null)
                    ClosePosition(position2);
            }


            if (current_SD < previous_SD)
            {
                var position1 = Positions.Find("OrdineVendere");
                if (position1 != null)
                    ClosePosition(position1);
            }

Let me know if this helps,

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 15:25

Hi quesnayquadrato,

Thanks for posting in our forum. Could you please explain to us what is the problem?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 12:36

Hi Alexander,

This is not possible. OnBar is called only the cBot's timeframe. If you want to handle the OnBar() on another timeframe, you will need to run a cBot on that timeframe as well.

An alternative is to run your code in OnTick() and check each time if a new bar has been added each timeframe series.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 11:17

Hi Bazan,

Thanks for posting in our forum. Currently cAlgo.API does not offer the tools you are looking for. Tradable instruments are not available and cBots are bounded to a Symbol and timeframe, even though it is possible to trade on other symbols as well and retrieve information about other timeframes. Maybe Connect API is a more appropriate technology to use in your case.

Please have a look and let me know if I can help you further.

Best Regards,

Panagiotis

 

 


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 11:05

Hi solark,

Thanks for the additional information. We have tested it locally and it works. Any chance you are missing something in the process?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 10:16

Hi Alexander,

From what I understand you want to operate on open positons. So my suggestions are the following

  1. Distinguish the positions of each cBot using a different label. 
  2. Use Select and Distinct  functions to get collections of open symbols and running robots.

See some examples below

            var robots = Positions.Select(x => x.Label).Distinct();
            var symbols = Positions.Select(x => x.SymbolCode).Distinct();

Let me know if these suggestions help

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 09:52

Hi Alexander,

Such information is not available at the moment via cAlgo.API. If you describe to us what you are up to, we might be able to propose a workaround.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Jul 2018, 09:12

Hi prosteel1,

You can search pending orders by label, in the same way you can do with positions. See example below

 PendingOrders.Where(x => x.Label == "My label");

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
05 Jul 2018, 14:27

Hi tradingu,

Can you please send troubleshooting information? To do so, tap 7 times on Logo in Settings.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
04 Jul 2018, 16:38

Hi prosteel1,

Thanks for posting in our forum. This seems to be a bug. The development team has received the necessary information and they are looking into it.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
04 Jul 2018, 14:55

Hi ctid418503,

Did you try recompiling the cBot as well each time you make a change in the indicator?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
04 Jul 2018, 14:52

Hi megha,

I tried to connect with the same broker and I have no issues. See below my messages.

Price Login

8=FIX.4.49=11635=A49=fxpig.300071156=CSERVER57=QUOTE50=300071134=152=20180704-11:50:3698=0108=30553=3000711554=xxx10=232

Price Response

8=FIX.4.49=8335=034=249=CSERVER50=QUOTE52=20180704-11:51:07.65056=fxpig.300071157=300071110=209

Trade Login

8=FIX.4.49=11635=A49=fxpig.300071156=CSERVER57=TRADE50=300071134=252=20180704-11:50:5298=0108=30553=3000711554=xxx10=201

Trade Response

8=FIX.4.49=9535=A34=149=CSERVER50=TRADE52=20180704-11:50:52.98856=fxpig.300071157=300071198=0108=3010=236

Check your messages for any typos or any other mistakes.

Best Regards,

Panagiotis


@PanagiotisCharalampous