Firetron’s UpdateOnInterval

2 641 Views 2 Comments 3 years ago
  • Calls a function on an interval, and remembers the previous result between the update intervals. Works the same as OptimizedForInterval/DefineIntervalOptimization, but with override feature.

    Custom Command Dependencies:
    None

    Test Script:

    local interval = 15
    local override = false
    
    local GetCurrentAsk = function ()
    
      return CurrentPrice().ask
    
    end
    
    local result = CC_UpdateOnInterval(GetCurrentAsk, interval, override)[1]
    
    Log(result)
    • This topic was modified 2 years, 9 months ago by Firetron. Reason: Changed description
    • This topic was modified 2 years, 9 months ago by Firetron. Reason: Changed description
    HaasScript Code
    Sign in or Register to download for free
    • #2844
      Kolvir
      Basic
      Up
      0
      Down
      ::

      Getting:

      ERROR: Unknown references: OpenTime

      v4 script?

      • #3598
        Firetron
        Basic
        Up
        0
        Down
        ::

        Yes, v4, maybe OpenTime is not a built in function in v3

Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free