Symbol.PipSize for all opened positions

Created at 12 Oct 2018, 14:40
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!
RE

RezaNoorimotlagh

Joined 12.10.2018

Symbol.PipSize for all opened positions
12 Oct 2018, 14:40


Hi,

I want to get print/report from several statment  for all position, but this statment " Symbol.PipSize" reported for one of them.

How to i can perform it for all opened position like to "position.StopLoss" .

for example: 

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{

    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class CV2 : Robot
    {

        protected override void OnTick()
        {


            foreach (var position in Positions)
            {
                Print("SL {0}", position.StopLoss);
                Print("The current symbol has pip size of: {0}", Symbol.PipSize);
            }
        }
    }
}


@RezaNoorimotlagh
Replies

PanagiotisCharalampous
12 Oct 2018, 17:55

Hi noorimotlagh.reza,

Try this

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{

    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class CV2 : Robot
    {

        protected override void OnTick()
        {
            foreach (var position in Positions)
            {
                Print("SL {0}", position.StopLoss);
                Print("The current symbol has pip size of: {0}",  MarketData.GetSymbol(position.SymbolCode).PipSize);
            }
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

RezaNoorimotlagh
13 Oct 2018, 14:25

RE:

Dear Panagiotis,

A Good Solution.

Regards,

Reza

 

Panagiotis Charalampous said:

Hi noorimotlagh.reza,

Try this

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{

    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class CV2 : Robot
    {

        protected override void OnTick()
        {
            foreach (var position in Positions)
            {
                Print("SL {0}", position.StopLoss);
                Print("The current symbol has pip size of: {0}",  MarketData.GetSymbol(position.SymbolCode).PipSize);
            }
        }
    }
}

Best Regards,

Panagiotis

 


@RezaNoorimotlagh