[pshaiCmd] Get Throttled Timeout

2 160 Views No Comments 3 years ago
  • Hey peeps!

    Here is a handy command that was designed to throttle order output based on change in the data series. The inputted data series can be anything, really, but it is recommended to use the close prices.

    The command works like this: you give it parameters, such as minimum/maximum timeout, minimum/maximum change and the lookback depth (aka. “the hang-time”) and of course the data series to calculate with. With these values, the command looks at the input data series (source) and calculates a percentage based changes between the values and uses those as the “strength”; the stronger the strength, the longer the outputted timeouts are. And when it is weak, the timeouts are shorter.

    The timeouts are also separated for buys/longs and sells/shorts: if changes are upwards, the timeouts for SELLs will grow and if downwards, the timeouts for BUYS will grow.

    TIP: This command could be used in market makers to throttle order output during strong moves.

    Also keep in mind, that since this command bases calculations on changes in data, it is more than recommended to use CC_HighSpeedPrices command data as the input series for this command. Closed candles can be too late for this command to be in its full potential.

    Inputs:
    * min_timeout – The minimum desired timeout in seconds. The result wont go below this value
    * max_timeout – The maximum desired timeout in seconds. The result wont go above this value.
    * min_pc – The minimum price change required to start calculating. Price change below and at this value produces a result of min_timeout. This is where the linear line starts.
    * max_pc – The maximum price change, the other end of the curve. Price change at and above this value produces a result of max_timeout. This is where the linear line ends.
    * depth – The amount of lookback for the timeout values. If depth is 10, the highest timeout value will last for 10 candles. (1)
    * source – The source values to base the price changes on.

    (1) The candles and their interval is based on the input source series.

    Hope you find good use for it!
    ~pshai

    HaasScript Code
    Sign in or Register to download for free
Login or Register to Comment

Unlock your crypto trading potential

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

Join for Free