How to ignore first trading signal for the day
Author: sofia
Creation Date: 12/10/2013 4:36 PM
profile picture

sofia

#1
Hello,

For daytrading , how to implement a code to ignore first trading signal of the day.
I close all positions at the end of the day. But want to ignore the first trading signal, next day.
I can do it manually, i.e ignore the first trade signal, but for backtesting and auto-trading purposes, I was wondering if it is possible to code this.

Thanks,

Sofia
profile picture

Cone

#2
One way would be to initialize a counter to 0 on the first bar of the day, increment the counter when signals occur, and test that it is greater than 1 before taking action, exampleÑ

CODE:
Please log in to see this code.

profile picture

sofia

#3
Thanks.

Sofia

This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).