I am stuck with an issue around trailing SL and breakevens and was hoping for some help.
...
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1
if (
// My Strategy to determine the Long Entry
)
{
EnterLongLimit(0,true, Convert.ToInt32(DefaultQuantity), (Low[1] - (Long_Negative_Offset_Arithmetic)) , @"LongTrade");
}
}
Condition 1: ASK is x ticks > entry price (example: "10")
Action 1: Set static SL to entry price + y ticks (example: "2")
Condition 2: ASK is z ticks > breakeven (example: "20")
Action 2: Replace Static SL with trailing SL to breakeven + y ticks (example: "18", i.e. 20-2)
Does anybody have an idea how I could do that?
Thanks so much, learning a lot here!
PS: the "Long_Negative_Offset_Arithmetic" is simply an adjustment to offset the limit entry price by the low of the previous bar - x ticks

Comment