Is there a way to use Symbol.VolumeInUnitsMin in MinValue Parameter?

Created at 13 Sep 2022, 11:27
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!
ST

sterpz

Joined 18.08.2022

Is there a way to use Symbol.VolumeInUnitsMin in MinValue Parameter?
13 Sep 2022, 11:27


Hi, is there a way to use Symbol.VolumeInUnitsMin in MinValue Parameter? It comes up with: Error CS0120: An object reference is required for the non-static field, method or property 'Algo Symbol'.

Does this mean I have to give Symbol.VolumeInUnitsMin an object reference or turn it to string?

 

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

namespace cAlgo.Robots
{
    [Robot(AccessRights = AccessRights.None)]
    public class NewcBot3 : Robot

    {     
        [Parameter("Volume", DefaultValue = 1, MinValue = Symbol.VolumeInUnitsMin)]
        public double Volume { get; set; } 

        protected override void OnStart()
        {
        Print(Volume);
        }
    }
}


@sterpz