Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trades trigger sending late

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

    Trades trigger sending late

    The actual order is just sent later than anticipated

    Example condition running OnBarClose

    // Cross over trigger
    && (SMA1[1] < SMA2[1])
    && (SMA1[0] > SMA2[0])

    && (StocktasticRSI[0] >= .50

    the expected is if RSI on last bar closed was >= 0.50 and the CrossOver occurred on the last bar ENTER LONG MARKET ORDER

    WHAT is happening is Cross over occurs but the RSI condition is < .50 and a random number of bars later the (SMA1[0] > SMA2[0]) is still true and the RSI crosses over .50, then it takes the trade but it has been multiple bars since the SMA Cross over

    THIS IS NOT THE EXPECTED TRADE

    Thanks

    #2
    Hello DTSSTS,

    Thanks for your post.

    How are you testing the strategy, in the strategy analyzer, or in a chart with historical data, or on live data, or on Playback with Market replay data?

    What is the calculate setting of the strategy? (Calculate.OnBarClose, Calculate.OnEachTick, Calculate.OnPriceChange)

    Does the strategy have additional data series?

    What bar type, bar size, and instrument are you using?

    Can you provide a screenshot of the unexpected trade? (That shows the entire chart)

    Have you printed out a bar-by-bar examination of the values involved to understand why the condition is evaluated as true even though you say it is not all true?

    Does the partial condition statement shown have as part its full context an "or" statement?

    Comment


      #3
      Testing on Live Data, OnBarClose - Yes multiple data series, Trades Conditions are on Primary

      BarType is 28 (renko style brick) 20 Primary Data , Instrument MNQ Micro, no screen shot at this time, I would have to reset resolution for screen shot to be large enough to see, but I could save chart as image i suppose

      The Condition is actually NOT true, the Cross Over did not just occur when the trade is made, the Condtions of bar[0] are both true when order is sent, but the condition of the PRE cross over bar[1] is NOT true any more that is the issue

      NOT or regarding the conditions in question

      Thanks

      I really do not think this makes a difference, but would it
      the conditions are of course a part of a larger group of other conditions as would be built in a strategy builder in ( ) like below is just part of the bigger set of conditions, these are the ones I wish to be considered together and trigger the trade or NOT. I do not want to wait on the RSI to become true later after the cross over

      // Cross over trigger
      && (SMA1[1] < SMA2[1])
      && (SMA1[0] > SMA2[0])

      && (StocktasticRSI[0] >= .50)

      WOULD ENCLOSING THESE TOGETHER FIX MY ISSUE with an Extra set of ( ) around the 3 lines

      // Cross over trigger
      && ((SMA1[1] < SMA2[1])
      && (SMA1[0] > SMA2[0])

      && (StocktasticRSI[0] >= .50))

      Thanks
      Last edited by DTSSTS; 01-28-2022, 05:52 AM. Reason: additional information

      Comment


        #4
        Hello DTSSTS,

        Thanks for your reply.

        My recommendation would be to create another strategy to test with and focus on those three conditions to verify their functionality together.

        I would also add drawing a dot on the chart below the bar where the conditions are true as this will show you every bar where it is true compared to entering an order. This would also be a good debugging technique to use with the current strategy.




        Comment


          #5
          Yes I like drawings or a backbrush to show when true or false, I use that often, in this case I would get the drawing when the actually order is being sent, how would I isolate the drawing to the trigger of the Crossover and then the group of 3 conditions, would i place the 3 in brackets as I have show above and place the drawing in those brackets as well.

          Not sure how to isolate to that part of the conditions Thanks

          Comment


            #6
            Hello DTSSTS,

            Thanks for your reply.

            My recommendation was to take those conditions to a new strategy and test in that manner first to verify expected functionality.

            If you want to do something like that with your existing strategy then I would suggest adding another set that has just those conditions and when true have that set draw as you wish.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            56 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
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X