Assembly must be Algo Type when building on VS 2022

Created at 05 Dec 2022, 03:05
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
TraderExperto's avatar

TraderExperto

Joined 07.06.2019

Assembly must be Algo Type when building on VS 2022
05 Dec 2022, 03:05


Hello Ctrader Team, I'm tring to create a Dll file on Visual Studio 2022 that uses the cAlgo.API in the reference, cause i have multiple functions that need access to some properties like Account, HIstory, Positions and etc, but the thing is that the only error that i get is Assembly must be Algo type. I've made some research but didn't found any solution. I also tried some simple peace of code to what could it be like in this post https://ctrader.com/forum/cbot-support/1739?page=2

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;

namespace cAlgo
{
    public class General
    {
        public static int GetPosCnt(Robot robot)
        {
            int iPosCnt;
            iPosCnt = robot.Positions.Count;
            return iPosCnt;
        }

        public static double GetLastCloseValue(Robot robot)
        {          
            return robot.Bars.ClosePrices.LastValue;
        }
    }
}

 


@TraderExperto