Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can I restrict my stratgies to run on a particular time period

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I restrict my stratgies to run on a particular time period

    Hi,

    As the subject, please let me know what is the function can restrict my stratgies to run only on a particular time period. I don't want my stratgies to place any orders for the first 20mins and the last 20mins during the market is open.

    Thanks,
    Jess

    #2
    Code:
    protected override void OnBarUpdate()
    {
    
    //Print ( "B4 Historical" );
        
    if (Historical) return;
        
    if ( BarsInProgress == 0 ) 
    {    
    
    if (    ToTime(Time[0]) >= ToTime( 9, 30, 00)
        &&  ToTime(Time[0]) <= ToTime( 16, 00, 00)) 
    {
    Originally posted by jesshon View Post
    Hi,

    As the subject, please let me know what is the function can restrict my stratgies to run only on a particular time period. I don't want my stratgies to place any orders for the first 20mins and the last 20mins during the market is open.

    Thanks,
    Jess

    Comment


      #3
      Hi sledge,

      thanks for your help.

      Regards,
      Jess

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ketoburning2, Today, 06:05 AM
      0 responses
      4 views
      0 likes
      Last Post ketoburning2  
      Started by ketoburning2, Today, 06:04 AM
      0 responses
      3 views
      0 likes
      Last Post ketoburning2  
      Started by Trader_Frank, Today, 05:35 AM
      2 responses
      7 views
      0 likes
      Last Post Trader_Frank  
      Started by ismaelcorleone, Today, 04:17 AM
      3 responses
      23 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by sidlercom80, Today, 03:45 AM
      0 responses
      8 views
      0 likes
      Last Post sidlercom80  
      Working...
      X