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 TheWhiteDragon, 01-21-2019, 12:44 PM
      4 responses
      543 views
      0 likes
      Last Post PaulMohn  
      Started by GLFX005, Today, 03:23 AM
      0 responses
      3 views
      0 likes
      Last Post GLFX005
      by GLFX005
       
      Started by XXtrader, Yesterday, 11:30 PM
      2 responses
      12 views
      0 likes
      Last Post XXtrader  
      Started by Waxavi, Today, 02:10 AM
      0 responses
      7 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by TradeForge, Today, 02:09 AM
      0 responses
      14 views
      0 likes
      Last Post TradeForge  
      Working...
      X