Open Trades Only During Certain Days

 

Hello,

 

I was wondering if anyone had any example code for opening trades during certain days.  I'd like to only open trades Sunday (when market opens) until Thursday.  If the trades are profitable by Friday, I'd like to close them out.  I'd like to do this to eliminate gap risk over the weekends.

 

Does anyone have any example code or scripts I could look at?

 

Thank you. 

 
You don't want to open on Friday and close on Friday. What's the problem? Show your one line test.
Reason: