Reverse entry in stock after exit

I want to write a code that when my stock exits I want the system to take a reverse entry. For example. If my entry condition is close crosses above EMA20 and exit condition is close crosses below EMA20, then when this exit happens, I want the system to take a reverse entry i.e. short entry when close crosses below EMA20.

@Streak @Vasu_patel can you help ?

1 Like

Hi @Chirayu08

Streak currently does not support Long-Short conditions in a single strategy. You can only go either Long or Short and hence you need to create two different strategies. One for Long and another for short to take both Long and Short trades.

For your requirement, you can create two strategies with opposite conditions for entry and exit. i.e. the exit conditions of the first strategy will be the entry conditions for the second strategy and deploy them together and this shall work fine.

For example, if your entry condition in ‘strategy 1’ is Close(0) crosses above EMA20 and your exit condition is Close(0) crosses below EMA20, you just need to create another strategy and keep the entry condition as the exit condition and exit condition from strategy 1 as entry condition for ‘strategy 2’.

Hope this helps.