Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with two time frames

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

    Problems with two time frames

    Hello, I'm working with two different time frames (5 and 1 minute). I need to put my orders in 5 minutes but it must run in 1 minute. I do it with this code:

    if (BarsInProgress == 0)
    {

    EnterShortStop(
    1,true,1,MyEntryPrice,"");
    }

    ...

    where 5 minutes is BarsInProgress=0 and 1 minute is BarsInProgress=1.

    If I use "false" like the second parameter my order is Accepted and Cancelled inmediately.

    If I use "true" like the second parameter I can't cancel my order when the 5 minutes have finished.

    Thanks in advance.

    Jesus.

    #2
    soyjesus, if the order is not set to liveUntilCancelled the next OnBarUpdate() call would cancel it - what TraceOrders output do you get when attempting to cancel the order then in your code?

    Comment


      #3
      Ok Bertrand, this is the result of the output:

      Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Ticks Value=30 Currency=0 Simulated=False
      Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=610,8 Currency=0 Simulated=False


      So the problem is that my order of new entry don't exist (only the Target and Stop orders).

      Before I have used "CancelOrder" when has finished the bar in the main time frame. I can see that whe I call to CancelOrder, I can send a new entry order in the future.

      Why?

      Jesus.

      Comment


        #4
        Is this the complete TraceOrders output you get? Please recheck and if possible post the full one so we can review, thanks

        Comment


          #5
          When my entry order is Accepted (but not filled) there isn't any problem. But when the main time frame is finished this is the complete TraceOrders output I get. Not more information is showed with the next bars.

          Comment


            #6
            Ok, so how do you attemp the placed order, if it's accepted and working? Do you work with IOrder objects, as this would be needed in the CancelOrder method...because with liveUntilCancelled it would remain working until you 'cancel ordered' it from within your code. It would help if you could post some pseudo code of how you have things laid out.

            Comment


              #7
              Ok I will send you the code but now I can't continue for today. I will contact with you the next Monday.

              Thanks and have a nice week end!

              Comment


                #8
                Thanks, sounds good - have a great weekend yourself soyjesus

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                41 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                124 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                64 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                41 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                46 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X