Take profit
Created at 29 Apr 2024, 21:16
EM
Take profit
29 Apr 2024, 21:16
Please help ,
where TP1 is moved to TP2: , using pendingorder execution. new takeprofit is not working.
result = TP1> TP2.
protected override void OnTick()
{
var longPosition = Positions.Find("_TP plus", SymbolName, TradeType.Buy);
if (longPosition == null) && (TP1 > TP2)
{
PendingLimitOrder(TradeType.Buy, SymbolName, 100000, "TP plus", StopLoss, TakeProfit);
}
else
{
if (longPosition.Pips >= Symbol.PipSize * 50)&& (TP1 > TP2)
ModifyPosition(longPosition, 30, TakeProfit);
if (longPosition.Pips >= 50)
ModifyPosition(longPosition, longPosition.EntryPrice + Symbol.PipSize * 30, longPosition.TakeProfit);
Print(result);
Thank you
PanagiotisCharalampous
30 Apr 2024, 05:34
Hi there,
Please provide a full cBot code that builds and then explain to us how we can reproduce your issue in backtesting.
Best regards,
Panagiotis
@PanagiotisCharalampous