I have run a problem when I want to set 2 entries and take profits one of them with profit target parameter.
I am trying to take profit half of the entries and let rest of the entries go until exit conditions are met.
This works well in backtesting but when I am running live simulation the profit target closes both entries.
Any advises for the problem?
PTargetValue = 200;
SetProfitTarget("Longentry1", CalculationMode.Currency, PTargetValue);
SetProfitTarget("Shortentry1", CalculationMode.Currency, PTargetValue);
// Enter Long
if (Logic to enter long)
{
EnterLong(Convert.ToInt32(EntryQuantity), "Longentry1");
EnterLong(Convert.ToInt32(EntryQuantity), "Longentry2");
}
// Enter short
if (Logic to enter short))
{
EnterShort(Convert.ToInt32(EntryQuantity), "Shortentry1");
EnterShort(Convert.ToInt32(EntryQuantity), "Shortentry2");
}
BR
Gelotuz
Comment