Topics
16 Nov 2023, 07:42
 1135
 1
15 Nov 2023, 10:36
 2026
 16
Replies

Spotware
27 Mar 2014, 12:08

Yes, you can:

var myLabelCount = Positions.Count(p => p.Label == "some label");

Another way to calculate positions with specific label:

var myLabelCount = Positions.FindAll("some label").Length;

 


@Spotware

Spotware
27 Mar 2014, 12:05

RE: How to change character in string

breakermind said:

Hi,

How to change character in string ?

string

21312312_32323232

to this

21312312#32323232

You can use string.Replace method.

var source = "21312312_32323232";
var result = source.Replace('_', '#');

 


@Spotware

Spotware
27 Mar 2014, 09:21

No, cAlgo.API doesn't provide such functionality. You can add your idea to vote.spotware.com


@Spotware

Spotware
27 Mar 2014, 09:09

RE: RE:

Forex19 said:

Spotware said:

Please look at the following example:

var eurUsdPositionsCount = Positions.Count(p => p.SymbolCode == "EURUSD");

 

Why gives me this error?:

Error CS1955: Non-invocable member 'cAlgo.API.Positions.Count' cannot be used like a method.

 

You need to add using System.Linq;


@Spotware

Spotware
26 Mar 2014, 16:56 ( Updated at: 21 Dec 2023, 09:20 )

No, it is not possible.
For such semi-automated system you can add several cBots with OnStart handlers to the same chart and start them by clicking start buttons whenever you want.

In such case you will have one button per one cBot.


@Spotware

Spotware
26 Mar 2014, 11:47

RE: RE:

Forex19 said:

Spotware said:

Please look at the following example:

var eurUsdPositionsCount = Positions.Count(p => p.SymbolCode == "EURUSD");

 

So if I want to have separate count for two Symbol, should I use:

var eurUsdPositionsCount = Positions.Count(p => p.SymbolCode == "EURUSD");

and

var eurGbpPositionsCount = Positions.Count(p => p.SymbolCode == "EURGBP");

is correct?

Yes, it is correct.


@Spotware

Spotware
26 Mar 2014, 11:20

Please look at the following example:

var eurUsdPositionsCount = Positions.Count(p => p.SymbolCode == "EURUSD");

 


@Spotware

Spotware
26 Mar 2014, 10:38

cAlgo.API doesn't provide access to the historical market depths.

You can retrieve only current snapshot of the market depth.


@Spotware

Spotware
26 Mar 2014, 10:35

        public override void Calculate(int index)
        {
            spread1[index] = Math.Round(symbol1.Spread / symbol1.PipValue, 1);

Such expression is not correct, because Symbol.Spread is a current value of Spread. You can not match historical index with current value of spread. Probably you will see line with the same value in every point.


@Spotware

Spotware
26 Mar 2014, 10:31

It is currently not possible.

We can recommend you to post your idea to vote.spotware.com


@Spotware

Spotware
26 Mar 2014, 10:30

It is not a bug. In some environments (virtual machines, some specific versions of Windows) we can not retrieve traffic data. In such cases traffic indicators are hidden.


@Spotware

Spotware
24 Mar 2014, 14:05

instead of overriding OnPositionOpened method you need to subscribe to Positions.Opened event:

        protected override void OnStart()
        {
            Positions.Opened += OnPositionsOpened;
        }
        
        void OnPositionsOpened(PositionOpenedEventArgs obj)
        {
            ...
        }

 


@Spotware

Spotware
24 Mar 2014, 12:13

By design MarketData.GetSeries returns market series when next quote is received. When markets open the price changes are not so frequently and it takes some time to obtain new quote.

We are going to change this behavior.

 


@Spotware

Spotware
24 Mar 2014, 09:45

Please read Referencing Custom Indicators.

If you prefer shift-style indexes, you will like method Last of DataSeries class. 


@Spotware

Spotware
21 Mar 2014, 17:36

Thank you for your feedback. We understand the importance of optimization functionality, but unfortunately we can not provide any time range.


@Spotware

Spotware
21 Mar 2014, 17:30

Alexander and AimHigher, thank you for your informative feedbacks.

We have decided to increase priority of RefreshData functionality. Current plan is to implement it after Visual Studio integration will be finished. Stay tuned.


@Spotware

Spotware
21 Mar 2014, 17:25

Thank you for your idea. You can post it to vote.spotware.com.


@Spotware

Spotware
21 Mar 2014, 17:25

Thank you for your idea. You can post it to vote.spotware.com.


@Spotware

Spotware
21 Mar 2014, 08:42

RE:

emelenium said:

And how can we change positions.Comment? (in cAlgo)
 

There is no such functionality in cAlgo.API. You can post your idea to vote.spotware.com


@Spotware

Spotware
20 Mar 2014, 14:05

Hello

We will add snapping to the fibonacci tool in the future. 

thanks


@Spotware