How to write short strategies?

Strategyseeker.com accept short transactions now. A support for Sellshort() and Buytocover() was added, so you can now write short strategies, long strategies, or mixed one (gets complex, watch out).
A new value to market position was added too: -1. When we have a Sellshort position, the MP() function returns -1. This is used to issue a call (if all condition are met) to Buytocover.
The following is a Long and Short sample strategy:
Short Long Sample Strategy
Note that a new section was added, the short section. It is very similar to the long section but instead of Buy() - we use Sellshort() and Buytocover() replaces Sell(). This post assume you are familiar with Short strategies and is provided for demonstrating StrategySeeker script language for creating short strategies. Note the Buy() condition if ( MP() == 0 and which is similar to the Sellshort() condition. You could alternatively use here if ( MP() != 1 and for the Buy condition and if ( MP() != -1 and for the Sellshort condition. It will return same results. However, you may want to use the later conditions in a more sophisticated strategies, with multiple Buys and Sells. (will be explained in future post). The following is a clean version of the strategy:

Short Long Sample Strategy

Now, you can create a portfolio with this strategy and use the Chart module to draw trades and view reports as follows:

Short Long Chart Sample

The first trade (1) is a long one. Note that the trade starts with a green arrow pointing up (the Buy arrow as before) and the [G] box (click on it for trade summary) ahead. The trade ends with a red arrow that represents the Sell.
Trade (2) is a short trade. It starts with a red arrow pointing down (represents Sellshort) and end with the green arrow pointing up plus the [G] letter.

In the report, the short trades will look as follows:

Short Long Report Sample

Note that the Buytocover line (green arrow in the regular buy line) has a later date than the Sellshort line (orange arrow).

You can separate the short and long sections into two separated strategies and than add them to a single portfolio. This will allow you to get seperate reports and strategy chart color so you can compare between the too.

The following are separated strategies: one for the short section and the other for the log:

Short Long Chart Sample

Short Long Chart Sample

Thats it. As always, if you have any comment to suggestion, use the contact us link to tell us: http://www.strategyseeker.com/contact

StrategySeeker team!

X
Enter your Strategy Seeker username.
Enter the password that accompanies your username.
7 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
Secure Login

This login is SSL protected

Loading