Stopping Buy Orders at a Certain Time

wayum999

Active member
Joined
May 26, 2020
Posts
26
Likes
5
Hello again,

I use sessions to confine my trading times and it works well, but I was wondering if I have a session ending at 1pm, but I want to stop all buying at 12:45PM, how would I go about doing that using Java? I still want the strategy to be able to sell, just not buy anymore once 1245 hits. I know I need to make a call to get the time and then restrict my buy signals to be within that time frame using a conditional, but I am not totally certain how to go about doing that. Any help is greatly appreciated.

W
 

MotiveWave_Joe

Moderator
Staff member
Joined
Mar 26, 2019
Posts
223
Likes
67
Hi,
I know I need to make a call to get the time and then restrict my buy signals to be within that time frame using a conditional, but I am not totally certain how to go about doing that.
Will the getCurrentTime() method in the Defaults interface work?
 
Top