Symbol.PipSize for all opened positions
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);
}
}
}
}
Replies
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
PanagiotisCharalampous
12 Oct 2018, 17:55
Hi noorimotlagh.reza,
Try this
Best Regards,
Panagiotis
@PanagiotisCharalampous