Get TargetPrice Value from a pending order
Created at 10 Jun 2019, 23:27
MA
Get TargetPrice Value from a pending order
10 Jun 2019, 23:27
Hi, I need to get the Target price from a labeled pending order so I can use it.
I.e:
For a position labeled "Long_1" I would get entry price liske this:
Entry_Value = Positions.Find("Long_1").EntryPrice;
But how do I get the same from a Pending order called "Long_1" ?
Thank you.
Replies
PanagiotisCharalampous
11 Jun 2019, 09:49
Hi martin100181@gmail.com,
Thanks for posting in our forum. See below
var targetPrice = PendingOrders.First(x => x.Label == "Long_1").TargetPrice;
Best Regards,
Panagiotis
@PanagiotisCharalampous
martin100181@gmail.com
10 Jun 2019, 23:48
More:
In fact I need the following:
1. I create a pending order with a defined target price and a label. Lets say "Long_1".
2. Sometime after that, it is possible that the bot stoped or whatever, so on the start I need the bot to check if Long_1 exists as a Pending order or if it was executed and its now a position and get the entry pice value (or target price if it´s still a pending order).
3. As a result I need to have that price stores in a variable.
I hope I could explain myself.
Thank you!
@martin100181@gmail.com