Topics
Replies
Drummond360
22 Dec 2017, 15:07
RE: RE:
Thank you for such a quick reply, much appreciated...
My current code, below, is clearly flawed as I'm having to define the long and short target price... Can anyone help me define a single target price based on TradeType?
var sellOrderTargetPrice = Symbol.Bid - PipsAway * Symbol.PipSize;
var buyOrderTargetPrice = Symbol.Ask + PipsAway * Symbol.PipSize;
foreach (var order in PendingOrders)
{
if (order.StopLossPips == null)
ModifyPendingOrder(order, buyOrderTargetPrice, order.StopLoss, order.TakeProfit, Server.Time.AddMinutes(Duration));
}
Many thanks in adavance,
Drummond360
@Drummond360
Drummond360
22 Dec 2017, 13:18
What if you want to place a sell order below the current price? Would that be a StopOrder?
and would you still use ModifyPendingOrder to trail it onTick?
@Drummond360
Drummond360
22 Dec 2017, 23:00
This is my best effort so far:
var targetPrice = (order.TradeType == TradeType.Buy) ? Symbol.Ask + PipsAway * Symbol.PipSize : (order.TradeType == TradeType.Sell) ? Symbol.Bid - PipsAway * Symbol.PipSize:
It doesn't work as I'm such a programming newb, however I do feel like it gets the point acorss as to what I'm trying to achieve! Any pointers would be greatly appreciated...
@Drummond360