Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cross problem in volatile market

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

    Cross problem in volatile market

    Hello, I am having problems with the condition "Cross above" or "Cross below" in times of volatility. For example, I have a condition that triggers when the price crosses an average but it has given me error I suppose for a sudden movement of the price. It is the reason I find him. Would that be possible? In that case, would the option of => or =< be better depending on the case?

    Thanks

    #2
    Hello herkok,

    Thanks for your post.

    What Calculate setting are you using? Calculate.OnBarClose, Calculate.OnPriceChange, Calculate.OnEachTick?

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello herkok,

      Thanks for your post.

      What Calculate setting are you using? Calculate.OnBarClose, Calculate.OnPriceChange, Calculate.OnEachTick?
      OnPriceChange

      Comment


        #4
        Hello herkok,

        Thanks for your reply.

        With OnPriceChange this means your code will execute on every change in price and during volatile times it is certainly possible that a cross condition can be true on one price change and false on the next and repeating until price moves consistently in a direction. It is also possible that while the cross may be triggered, as price retreats it would look like the cross has not occurred.

        Basically a cross condition would be comparing the previous bar to the current bar to see if it is greater (or lessor) compared to the reference (other indicator or numerical value) to determine the cross condition.

        What is the error you are experiencing?

        Comment


          #5
          Originally posted by NinjaTrader_PaulH View Post
          Hello herkok,

          Thanks for your reply.

          With OnPriceChange this means your code will execute on every change in price and during volatile times it is certainly possible that a cross condition can be true on one price change and false on the next and repeating until price moves consistently in a direction. It is also possible that while the cross may be triggered, as price retreats it would look like the cross has not occurred.

          Basically a cross condition would be comparing the previous bar to the current bar to see if it is greater (or lessor) compared to the reference (other indicator or numerical value) to determine the cross condition.

          What is the error you are experiencing?
          Well, the error jumped on the screen and I quickly removed it, right now I don't remember what it said. Anyway I think I have solved it with the condition <> =

          thanks

          Comment


            #6
            How did you solve it?






            ​I am a programmer, good at programming, web design, software development
            Last edited by donwynne; 09-13-2022, 08:39 PM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            44 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
            65 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            42 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