Topics

Forum Topics not found

Replies

mpaggini
14 Sep 2022, 11:25

RE: RE: Statement

Spotware said:

breakermind said:

Spotware said:

breakermind said:

Hi,

how to retrieve the history of closed positions from calgo robot?

bye

you can use History collection

Hi,

HOW ?

and what the label?

can I generate Statement from robot?

really could not read the history of the position from the robot (it is a joke unless)?

 

PS.

If I see again "We will add this in the future."

I walk out of here and never come back ...

You can iterate through History collection:

foreach (HistoricalTrade trade in History)
{
    Print("EntryTime: {0}, ClosingTime: {1}, Profit: {2}", trade.EntryTime, trade.ClosingTime, trade.NetProfit);
}

 

if I use History collection the collection is empty

I have a loto of closed positions but I can't find any position

 


@mpaggini

mpaggini
05 Sep 2022, 09:57

RE:

amusleh said:

Hi,

You can set the object IsInteractive flag to True:

using cAlgo.API;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class DrawIcon : Robot
    {

        protected override void OnStart()
        {
            string sMessage = "Long " + Bars.LastBar.OpenTime;
            var icon = Chart.DrawIcon(sMessage, ChartIconType.UpArrow, Bars.LastBar.OpenTime, Bars.LastBar.Low * 0.999, Color.FromHex("#DDE7E7E7"));

            icon.IsInteractive = true;
            icon.IsLocked = true;
        }

        protected override void OnTick() {}

        protected override void OnStop() {}
    }
}

The IsLocked is an additional optional step which disables moving of object, but you can turn it on/off from object settings.

This not work for me, when bot stop all drawed object disappar, also in backtest


@mpaggini