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 Karado58, 11-26-2012, 02:57 PM
      8 responses
      14,828 views
      0 likes
      Last Post Option Whisperer  
      Started by Option Whisperer, Today, 09:05 AM
      0 responses
      1 view
      0 likes
      Last Post Option Whisperer  
      Started by cre8able, Yesterday, 01:16 PM
      3 responses
      11 views
      0 likes
      Last Post cre8able  
      Started by Harry, 05-02-2018, 01:54 PM
      10 responses
      3,204 views
      0 likes
      Last Post tharton3  
      Started by ChartTourist, Today, 08:22 AM
      0 responses
      6 views
      0 likes
      Last Post ChartTourist  
      Working...
      X