DA
Topics
28 Aug 2022, 17:23
673
1
04 Aug 2022, 14:21
571
2
11 Jun 2022, 19:09
883
2
03 Jun 2022, 11:04
1425
4
dave_gryp
11 Jun 2022, 19:01
RE:
amusleh said:
Many Thanks Amusleh. That worked! I am getting used to the modify position now. The new problem that I have is I am getting this error:
08/04/2019 02:36:00.000 | → Modifying position PID2 (SL: null, TP: 1.12196) FAILED with error "TechnicalError", Position PID2
I have 2 positions open a buy and a sell. The position that has the error has been previously modified. I would just like to know if there is some more in depth reference material that I can use to trouble shoot this.
This is the Modify code that is causing my error:
spread = Symbol.Ask - Symbol.Bid;
halfSpread = (spread / 2);
if (Positions.Find(Short).Pips < 0)
{
shortPriceLine = Symbol.Ask - (Math.Abs(Positions.Find(Short).Pips) * pipsFactor /*0.0001*/);
double longShortDistance = shortPriceLine - Positions.Find(Long).EntryPrice;
double centralPriceLine = (longShortDistance / 2) + Positions.Find(Long).EntryPrice;
Positions.Find(Short).ModifyTakeProfitPrice(centralPriceLine + halfSpread);
Positions.Find(Long).ModifyStopLossPrice(centralPriceLine - halfSpread);
Many Thanks again.
@dave_gryp