Hi Eugene,
I see that in a chart view, if you select weekly scale, the bar is created with the Monday opening price and used the closing price of the Friday for the closing price (except if Monday or Friday are holidays). This logic is fine for me.
But when you look trade results for the following trading strategy executed on a weekly scale, you will see that the date selected is the Friday with the opening price of Monday for each entry.
I would like to understand why this is not the same logic as the chart view ?
CODE:
Please log in to see this code.
RUN The strategy for UNH and you will have the following trade.
QUOTE:
Position Symbol Quantity Entry Date Entry Price Exit Date Exit Price Profit % Profit $ Bars Held Profit per Bar Entry Name Exit Name MAE % MFE %
Long UNH 25 3/31/2017 163.99 Open Open 0.59 $24.25 3 $8.08 -0.76 1.99
Size:
Color:
Hi Alexandre,
QUOTE:
the date selected is the Friday with the opening price of Monday for each entry.
In WL, the bar is timestamped with the time at the end of bar i.e. Friday. The 3/31/2017 bar spans the dates from 3/27 to 3/31 inclusive. It does not matter that your strategy has bought on Monday - or even if it did on any other day of week. The bar is always marked with the last trading day of week (Friday in this case). Likewise in the Trades view it's the
bar's date, not the trade's actual date - because you're dealing with compressed bar.
To stress it: what the Trades view indicates is not the trade's actual date within the bar but the bar's end date. Just give it a thought. The fact that an intraday strategy running on 60-min data buys on say 10:45am doesn't put 10:45am in the Trades view or when you mouse over the trade on the chart. It's timestamped 11:00am. The same is with Weekly or other compressed data.
QUOTE:
I would like to understand why this is not the same logic as the chart view ?
The logic is absolutely identical. Monday's open price is the bar's Open price, Friday's close price is assigned to the bar's Close.
Size:
Color:
Thank you Eugene. I understand the logic.
But in the real trading, if the order reach the opening price (with a market order), the lowest/highest price (with the appropriate limit order), the date wouldn't be the Friday. As the scale is compressed, you can detect the correct date of the execution on theses particular cases. For all other cases, your logic is the best.
It could be a nice to have feature in the future.
Size:
Color: