Taking a Trade at opening

Hello @Streak,

I wish to take a trade at certain stocks at an opening price exactly at 9:15 AM and book a profit of 1%-2% as per my wish.
Can this be designed in streak?

NOTE: I have searched on the website, and found OHL in 1 min timeframe. I don’t want that. I don’t want to buy @ 9:16AM. I want to take position in the moment the market opens. The order should be MIS.

Also another concern I wish to share:
Previously I was able to backtest for a given date. Why can’t I do that now? Why you folks changed it?
I want my strategy to test only on 5-Aug-2020. Now I have to select a 1-week date range. This is ridiculous.

1 Like

Is it a market order or ? options or equity or futures?

This is currently not possible. But some updates are planned to be released which will allow this in the future.

Testing a strategy only for a day is statistically not significant. Such a short period has a very less probability of generating alpha. Having said that, this was done because several technical indicators take some time (data) to smoothen.

When you check the charts, the indicator is calculated considering all historical data. However, when you backtest and provide a start and a stop date, the data for only that period is fetched, and then indicator based on your conditions is calculated and then your condition is checked.

For example, your strategy is Close crosses above EMA 200

When you run the above condition for one day, the data for only that day is fetched and then a 200 period EMA is calculated. One EMA value is this scenario is calculated by averaging 200-period data. Now, depending upon the timeframe, you might not have enough data point to actually calculate a 200 EMA.

Also, EMA works with the principle that it gives more weight to recent data, in other words, current EMA is also dependent on previous candle EMA. If you calculate, EMA on 1,000 data points and 10,000 data points, you will find that EMAs calculated on the same candles would be different. This is because the more EMA data is calculated, the smoother it becomes.

If you compare the difference of the EMA values in the above example, there might be a big difference. Now instead of running the condition on 1000 data points, you run it on 5000 or 7000 data points, you will find that difference has decreased significantly. In other words, smoothened averages have a negligible difference.

So if you backtest on more data, there will be a negligible difference between the EMA that you see on the chart and the one which you backtest upon.

Also, EMA is not the only indicator, that requires smoothening. RSI, ADX, Supertrend also requires more data.

Ideally, users should not backtest for a day. It does not serve the purpose. Many users did not understand this and it can be a bit heavy. Hence we had to add the limit so that users do not make this mistake.

A lot of thought is put into every option that we add/remove. Our efforts are always in making our client’s life easier. Hope this gives a better clarification.

When we are backtesting a failed entry or exit condition, its very helpful to have the option in a given timeframe for a day…while its possible to set timeframe, similar option to set a day will be useful. While you can run the simulation for any number of days required to generate the indicators in background, show the results only for the selected time frame…

its also helpful in comparing backtest vs actual results vs paper trade…
@Streak

You can use Candle Time for this.
image

Can you elaborate on this?

This comparison needs to be done by the user. Here is a link to understand how to read the backtest results.

No. I am referring to the flexibility to run a backtest for a specific date where entry or exit criteria fails.

If indicator requires back test to be run min for a week and hence the functionality of running a backtest for a specific date is not possible, would it be possible to run the process needed for a backtest for a week or month(whatever is required for indicators) but in the backtest results filter and show only for the timeframe specified by the user?

for example, if my backtest shows that entry or exit criteria is failing on 20th may 1015 AM, I would limit the time to 10:10 to 10:20 but i still need to specify 18th may to 27th may and filter thru the results to get to 20th may 10:15…Instead, can the user be given flexibility to specify 20th as start and end date, but let the process run for a week or whatever time it is required to calculate the indicators…
maybe I misunderstood the explanation given if this is not possible

How do you build indicators during backtest for 1st selected date in the range specified without the preceding historical data or how do you build indicators for a time restricted back test lets say 12-2PM without the 9AM-12PM data? Shouldnt it be possible to build indicators same way if user restricts the date for a single date only…

Yes, going through the tutorials and blogs. Thank you for the good material…It took almost no time to start simulating trades…

This delay of waiting till candle close is also the main reasons why back tests are not matching paper trading results apart from other reasons ofcourse. Also, with what I hear about streak only giving a notification and not performing auto trade due to regulatory rule, makes it very difficult for a more practical usage in a quick intraday trades. Is there a plan in the future to support LTP based signalling instead of signal post the close of the candle?. Because, many times by the time candle closes, the opportunity is already lost apart from other slippages and hence I see current functionality being useful mostly for relatively short or long term trades than some quick 2-5 mins or even 10-15 min entry and exit trades for that matter…

Consider this example, from the chart, close price of 577.75 is the trigger for the condition at 3:05 PM. but during paper trading, the buy alert is triggered not even at 3:06 but at 3:07, thats 2 mins of lost time already without accounting for other slippages and it would be 3 mins if my requirement was to trigger something based on open price of a candle.

image

From the past feedbacks and discussions, I see a vast improvement with lot of feedback already incorporated in a short time frame…I hope future enhancements meets my requirements. Thank you.

Currently, this is not possible. But in the future version, a filter can be added.

All data is looked into when you select a time range but I cannot elaborate on the backend process,

Our backtest result is the closest approximation of a real trade but there will be some difference of course but this is not because of time only. For example, if 50 traders place a market order on the same contract at 9:15-20 AM, there is a high probability that the prices they receive will vary even if it gets executed at the same time, unless there is one large order on the other side with the same price which is able to absorb all the 50 orders. The slippage on a lot of stocks can be much less. This is why you can consider a minimum of 2-3% of slippage on the backtest results. That is a conservative assumption.

Refer to the following link to understand the issues with LTP-based triggers.

Yes, auto-order placement unfortunately is not possible at this point of time.

I completely understand the slippages due to other factors, My concern is the added slippage of not being able to take the trade till the close of the candle plus slippage due to missing autotrade. Ofcourse, the later one is not in your hands and hence I have no request with respect to that but the former one can be addressed.

Yes it does and I get the reasoning behind it. I do understand the concerns w.r.t false positives but this is something that user should have the freedom to build into his entry condition. If he/she does not want to trigger based on false positives, then the entry condition should be appropriately set i.e

  1. either use n-1 candle to confirm the pattern or
  2. we continue to use OHLC variables for triggering after completion of candle but introduce LTP and only this triggers based on current candle. OHLC can be continued to use by those who want to wait till confirmation and LTP for those who want immediate triggers.

The target scenarios for this requirement is intraday reversal trades or the ones like below where things move very fast,

At 13:33, my entry condition of candle low breaching 34860 is met and assuming its triggered at 13:34 after completion of 13:33 candle, I do not see much effect and it is still a false positive even after having this candle close signalling approach and will lets say hit a stop loss of 34880 at 13:40, If my stoploss was larger well and good, the trade would probably continue and be successful

But even in presence of a larger stop loss if instead of 13:33, we ended up in a situation of 13:42 directly when 34860 is breached again, the trigger theoretically would not get enabled till next candle where it is already at 34800 and even there the additional delay of alert being triggered after few seconds to process the entry condition + user notification and other slippages will result in trade being taken below lets say 34740 at 13:43 and hits a stop loss of 34760 or 34780 depending on the configured stop loss.

so in effect,

  1. candle LOW breaching 34860 is late by one candle. Opportunity lost considering other slippages.
  2. candle OPEN breaching 34860 is late by 2 candles . Opportunity lost even before entry!

The hope is that a candle LTP will trigger the condition at 1342 itself and considering the other slippages, even if we can capture at 34800, this would give the user a fair chance of capturing atleast a part of the opportunity. I do not even have the option to check its feasibility since we do not have a way to configure whether to wait till candle close or LTP.

Infact, the back test gave exact result like I speculated above resulting in a capture of 50 points fall as you can see below but the paper trading and I assume live trading too like paper trading would end up with an opportunity lost.

The reason why alerts are generated and delivered in 10-15 sec is that it takes time to consolidate all the ticks to make sure triggers get generated on the most accurate candles possible. You might have observed that at certain times, the OHLC values of a candle changes after it closes in chart, the reason is the same. The gap is to allow the consolidation so that triggers, would match the chart. Read this post to learn more about this.

But yes, the effort will able be to reduce this gap to enable faster notification,

As regards to triggers based on LTP, while there are many types of strategies that use LTP or perhaps TBT data for placing trades, they are currently not possible to be implemented, unfortunately.