Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

6281 operations just after starting the strategy

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

    #16
    Hello r68cervera,

    When using if (State == State.Historical) return; that will prevent historical trades, when you start the strategy without historical trades it will immediately trade as soon as it enters realtime if your condition is true which it was. When you don't use this condition the strategy will place historical trades and will start differently because it may or may not be in a historical position when entering realtime.

    In regard to your latest post I am not sure what you are asking in relation to the code.

    Comment


      #17
      Hi mbcito and thanks for your reply, I have tried the State declaration in several ways (as Jesse told me and as you told me) but the problem is not exactly there
      thank you very much​

      Comment


        #18
        Hi Jesse, good morning, yes, that is what happens. I understand what you are saying, and I understand what is happening, but what I don't understand is why it is only executed on the first bar.
        The logic says that if it is less than 250 it executes the order, and what I don't understand is why it doesn't always do it, because always when the bar starts the value is going to be 0, which is what happens with the first bar, 0 <250 YES, I EXECUTE THE ORDER
        And after executing the order on the first bar, then it waits until the end of the bar, to do the check

        Thank you very much, and don't worry, I will keep looking at something to see if I can solve this
        Thanks​

        Comment


          #19
          Hello r68cervera,

          You would have to be using OnEachTick or OnPriceChange calculation to have it update in the middle of a bar, if you use OnBarClose it will be only at each bar close. Also if you have entered an order the next order will be ignored if you are still in a position from that original order, you posted a log entry showing an ignored order in post 12, the strategy tried to submit another entry before the previous was closed so it was ignored.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          58 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          133 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          73 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X