Let me get your take on this because you're smarter than me. Only asking for brainstorm, not feature request.

How would one go about putting into trade execution logic:

buy on downtick.

sell on uptick.

Initial thought sudo code: 

  1. ###when trade entry or exit condition is hit, at any resolution, then send to execution which looks at tick resolution
  2. #all this to avoid having a bad market impact
  3. if buy_trade
  4. if tick[-1] < tick[-2]
  5. trade at limit = last price
  6. if sell_trade
  7. if tick[-1] > tick[-2]
  8. trade at limit = last price

Idea from: 

 

 

Author

Foren Power

November 2022