Hi, 

number 1 is a valid possibility. However, it should be recognized that this 
will also mean that (depending on instrument) you may end up with open 
positions over the weekend as on Friday trading typically stops earlier and 
if you have an open position at this time, you are just stuck with it.

An alternative would be to put the small gap at the end of the friday 
trading session to not run into the weekend problem. However, this would 
mean that during the week the position will be closed always before after 
the hour trading. It depends on your strategy, whether you want to do this 
- or not. 

Option 2 does not have the weekend problem, but does exactly do the 
intermediate position closing. 
Given that parameters might actually be different during the different 
slots, it seems the more appropriate approach, however.

It would however, be interesting to have an extension for JBT for full week 
trading schedules to minimize number of sale / buy actions for long-running 
strategies.

Cheers
  Klaus


Am Donnerstag, 27. September 2012 15:06:19 UTC-4 schrieb nonlinear:
>
> Hello  Bangfu ,
>
> I'll mention three things here:
>
> 1. You can capture both the day and night session by setting the trading 
> schedule to arbitrary wide period within the day. For example:
> TradingSchedule tradingSchedule = new TradingSchedule("0:01", "23:59", 
> "America/New_York");
>
> 2. Alternatively, you can run three strategies at the same time, one for 
> day session, and the other one for night session, and one for overnight 
> session. For example:
> TradingSchedule tradingSchedule = new TradingSchedule("9:30", "16:00", 
> "America/New_York"); 
> TradingSchedule tradingSchedule = new TradingSchedule("17:30", "23:59", 
> "America/New_York");  
> TradingSchedule tradingSchedule = new TradingSchedule("0:01", "9:30", 
> "America/New_York");   
>
> 3. Once the trading schedule is set, you can run the strategy without 
> restarting JBT or TWS until the contract expires. Effectively, once you 
> start it, you can go away, and the strategy would trade every day on the 
> schedule.
>
> On Thursday, September 20, 2012 3:47:36 AM UTC-4, Bang wrote:
>>
>> Hi Guys
>>  
>> Is there any way to set the TradingSchedule for both day & night 
>> session, or even a whole week? 
>>  
>> Thanks advance
>> Bangfu
>>  
>>  
>>  
>>
>

 

-- 
You received this message because you are subscribed to the Google Groups 
"JBookTrader" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/jbooktrader/-/IYbVbkECFu4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jbooktrader?hl=en.

Reply via email to