I need help turning this short pseudocode into a C# sentence if possible
/*In this example, the value "Benchmark" is a higher value that serves as an ExitShort() stop loss when in a short position and OnBarUpdate updates on each tick*/
//Trading NQ Example values: Benchmark = 12000.00, currentEntryPrice = execution.Price (11990.00 - Entry is always 10 points below)
if (Position.MarketPosition == MarketPosition.Short)
{
/*pseudocode*/
if ((current bid && ask is greater than or equal to Benchmark) && (current bid && ask is not lower than or equal to currentEntryPrice))
{
ExitShort()
}
}
I was thinking of writing something like this because on my last trade, I entered short, then the market rose to hit my Benchmark value but did not exit. Instead, the market came back down, passed my initial entry price and executed the ExitShort() method a few points below my entry. One might say that this is good since I exited for a small profit but actually I missed out on +200 points going short that day because of a faulty exit.
What should have happened was : ExitShort() at Benchmark, Enter again when market hits my Entry Price (10 points below Benchmark) and take profit and my desired profit target.
I assume my exit executed where it did because volatility was very high and my account experienced major slippage.
If writing something like this is not possible, is it then possible to ignore an ExitShort() method under any circumstances?

Comment