In the second cell enter the formula – =K1+I2, and drag it to the rest of the cells. In the first cell of the column K, enter the value of the trading price of the first trade(which is 109.68). Equity Curve for Excel Trading Spreadsheet You should find the average return per trade to be 0.3%. This will give the returns in percentage. In the J column, enter the following formula into cell J2 – =I2/D2, and drag the formula to the rest of the cells in the column. The total number of trades made were 774, The average return per trade was 0.638 Rupees. You will see the statistics of this column near the lower right. Sheets("Trades").Cells(pnlRow, 4) = Cells(row, 6)Īfter running this subroutine, this is how the sheet “Trades” should look like – Sheets("Trades").Cells(pnlRow, 3) = "Long" Sheets("Trades").Cells(pnlRow, 2) = Cells(row, 2) Sheets("Trades").Cells(pnlRow, 1) = DateValue(Cells(row, 1).Value) Sheets("Trades").Cells(pnlRow, 4) - Sheets("Trades").Cells(pnlRow, 8) Sheets("Trades").Cells(pnlRow, 8) = Cells(row, 6) Sheets("Trades").Cells(pnlRow, 7) = "ShortExit" Sheets("Trades").Cells(pnlRow, 6) = Cells(row, 2) Sheets("Trades").Cells(pnlRow, 5) = DateValue(Cells(row, 1).Value) Sheets("Trades").Cells(pnlRow, 4) = Cells(row, 6) 'Price Sheets("Trades").Cells(pnlRow, 3) = "Long" 'Action Sheets("Trades").Cells(pnlRow, 2) = Cells(row, 2) 'Time Sheets("Trades").Cells(pnlRow, 1) = DateValue(Cells(row, 1).Value) 'Date (Range("F" & row - slowPeriod + 1 & ":F" & row)) (Range("F" & row - fastPeriod + 1 & ":F" & row)) If 8 Period SMA > 21 Period SMA AND current position is Short, then exit Short position and Go Long on the same amount of shares of the stock.įastAvg = _ And whenever the trend changes to a downtrend, the 8 Period SMA dips below the 21 Period SMA. We can observe that whenever there is a reversal, and the trend changes to an uptrend, the 8 Period SMA crosses the 21 Period SMA and becomes more than 21 Period SMA. Try to observe what happens to the 8 period SMA and 21 period SMA when the trend changes. The above image is a chart of SBI Hourly Closing Stock price plotted along with its 8 Period Moving Average and 21 Period Moving Average. One of the best ways to make a profit in the markets is to just spot a trend, and based on whether it is a downtrend or an uptrend, enter a position in either long or short, and stay with the position till the trend reverses.īut how do you design an algorithm so that it can recognize trends?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |