02. Long and Short Strategies
A strategy can be long-only, short-only or can consist of both long and short trades.
A long-only strategy is when you enter the trade with a BUY signal and you exit the trade with a SELL or a CLOSE signal. It means that you are always buying first and then exiting later.
Let's check out how to write a long-only strategy with Orca.
In the above code, you are entering with some entry criteria and you are exiting with a close criteria. A simple buy and hold is a good example of long-only strategy
A short-only strategy is the opposite of a long-only strategy, which means that you sell first and then buy later.
In the above code, you are entering a short position on entry criteria and you are exiting the trade by having a close or BUY signal. This is a simple example of short-only strategy.
Now let's take a look at a strategy that can have both long and short signals.
In the above code, on entering the first entry criteria, you are entering into a long position and on the second entry criteria, you are entering into a short position. On the exit criteria 1 and 2, you are exiting the previously entered long and short positions. This way, you are closing the trade with both long and short signals.
Last updated
Was this helpful?