Advanced Strategy Parameters

Advanced Strategy Parameters

Quick article search

MoonHook Strategy and Its Parameters

This strategy is part of the MoonBonus package and is available only to PRO users who registered exchange accounts using our referral links. The list of referral links for different exchanges can be found on this page MoonBonus.


The strategy detects a rapid price drop and places a Buy order, which then moves within its price corridor, similar to the MoonShot strategy, waiting for a repeated spike.


Both the corridor and the initial order position depend linearly on the actual detection values. The speed of the drop is determined by the HookTimeFrame parameter (analysis interval). The strategy was originally designed to catch spikes (HookTimeFrame = 2 seconds), but larger intervals (up to 40 seconds) can also be tested.


Notes


  1. Due to the internal mechanics of the MoonHook strategy, a repeated detection is possible no earlier than HookTimeFrame seconds later. Without this internal penalty, detection spam could occur.

  2. The strategy recalculates detection conditions once every half second.

  3. Unlike other strategies, BuyModifier in this strategy affects the width and depth of the corridor.
    How it works: at the moment of detection, delta values are фиксated. If the deltas then begin to grow, the difference between the current deltas and those recorded at detection, multiplied by their coefficient, affects the lower and upper boundaries of the corridor.


Example:


BuyModifier = -3 (must be negative!)
Add3hDelta coefficient = 0.05
hDelta at the moment of detection = 10
Later, 3hDelta increases sharply to 50
Difference = 40.


If at the moment of detection the price movement corridor was -2%, -3%, then when delta becomes 50 (difference = 40), the corridor will be:
Upper Boundary = -2 + (40 × 0.05 × (-3) / 2) = -5%
Lower Boundary = -3 + (40 × 0.05 × (-3)) = -9%


⚠️ Important! The upper boundary expands, but increases exactly two times less than the lower boundary. This results in corridor widening.


  • BuyOrderReduce: field for specifying the interval in milliseconds over which the average trading volume is calculated. The strategy will place a Buy order no larger than the calculated average volume. By default, BuyOrderReduce = 100 (ms). If set to 0, the parameter is not applied.

    Volume is calculated as follows: the total volume of all buy and sell trades (BV + SV) over the TimeInterval is summed and divided proportionally by BuyOrderReduce. For example, if TimeInterval = 5 seconds (5000 ms), BuyOrderReduce = 100 ms, and the total traded volume over 5 seconds is $10,000, then the average volume per 100 ms will be: 10,000 / 5000 ms × 100 ms = $200. In this case, the strategy will place a Buy order no larger than $200.In other words, the strategy determines the average volume over 100 ms (or 10 ms / 5 ms, depending on the value set) — this becomes the maximum allowed order size.

    The order reduction function can be seen in the log with a message such as:
    IOTA: [1] (40) Buy order reduced: 1000.00$ => 23$ (Vol: 23$).
    In this example, OrderSize in the strategy was set to $1000, but the average trading volume over 100 ms was only $23, so the strategy placed a Buy order for $23;

  • MinReducedSize: field for specifying the minimum Buy order size in USDT after applying BuyOrderReduce. If the calculated reduced size is below this value, the Buy order will not be placed.
    For example, if MinReducedSize = 50 (USDT) and after applying BuyOrderReduce the calculated size is $23, the Buy order will not be placed.
    If set to 0, the parameter is not applied;

  • HookTimeFrame: field for specifying the analysis time interval in whole seconds (from 1 to 40 seconds);

  • HookDetectDepth: field for specifying the minimum detection depth in percent;

  • HookDetectDepthMax: field for specifying the maximum detection depth in percent. If 0, not applied;

  • HookAntiPump: YES/NO checkbox.
    If YES s set, the average price before detection is used to calculate detection depth, which helps exclude spikes occurring immediately after a rapid price increase;

  • HookPriceRollBack: field for specifying the minimum price rollback percentage relative to the total movement depth.
    For example, HookPriceRollBack = 33 (%) means a rollback of one third of the total price move;

  • HookPriceRollBackMax: field for specifying the maximum rollback percentage relative to the total movement depth. If 0 is set, not applied;

  • HookRollBackWait: field for specifying the time in milliseconds during which the price must remain above the HookPriceRollBack level. The recommended value is 100 ms — this helps filter out cases with a single random trade (cross) that may appear immediately after a spike within the spread. Higher values may be used, but the entire sequence (spike, rollback, and waiting period) must fit within HookTimeFrame seconds;

  • HookDropMin: field for specifying the minimum percentage price drop before detection, calculated relative to the recorded spike depth over the last 2 minutes. If 0 is set, not applied;

  • HookDropMax: field for specifying the maximum percentage price drop before detection, calculated relative to the recorded spike depth over the last 2 minutes. If 0, not applied.
    Example: a spike of 10% occurred. During the preceding 2 minutes, the coin had already dropped 20% before the spike.
    Then: HookDrop = 20 / 10 × 100 = 200%
    That is, the prior drop was 200% larger than the spike itself;

  • HookDirection: menu for selecting the direction in which detections are searched:

    • Both – in both directions;

    • OnlyShort – upward spike;

    • OnlyLong – downward spike.

  • HookOppositeOrder: YES/NO checkbox.
    If YES is set, the Buy order will be placed in the opposite direction of the detected spike.
    For example:

    • If HookDirection = OnlyShort (upward spike) and HookOppositeOrder = YES, a long Buy order will be placed;.

    • If HookDirection = OnlyShort (upward spike) and HookOppositeOrder = NO, a short Buy order will be placed;

    • If HookDirection = OnlyLong (downward spike) and HookOppositeOrder = NO, a long Buy order will be placed.

  • HookInterpolate: field for specifying a value from 0 to 4:

    • If 0 is set, the strategy places the Buy order based on the upper price before the spike;  

    • If 1 is set, the Buy order is placed from the rollback price after the spike (from the RollBack price);

    • If 2 is set, priority is given to the HookInitialPrice parameter;

    • If 3 is set, both the order and the corridor are calculated from the current price relative to the spike depth;

    • If 4 is set, calculations are made relative to the rollback depth.
      If the selected logic conflicts with the price corridor, the upper boundary of the corridor is moved upward by half the distance between your order and the current price.
      If this is physically impossible, the detection will not trigger.
      Within this logic, the lower boundary is reduced accordingly.
      The same logic applies to both short and long positions.
      If HookInterpolate is set to 0, the BuyModifier parameter is not applied.

  • HookInitialPrice: field for specifying the relative percentage at which to place the Buy order from the total price drop depth.
    For example, the price dropped by 10% from 110 to 100.
    If HookInitialPrice = 25 (%), the Buy order will be placed at 25% of the absolute 10% drop, that is 2.5% above the bottom point: 100 + 2.5% = 102.5.
    A negative value may also be specified — in this case, the Buy order will be placed below the lowest point of the drop;

  • HookPriceDistance: field for specifying the width of the price corridor as a percentage of the total detection depth.
    FoIf HookPriceDistance = 10 (%), this means the Buy order may move within:
    - Upper boundary: 5 − 5/100 × 10 = 4.5%;
    - Lower boundary: 5 + 5/100 × 10 = 5.5% relative to the current price.
    The corridor moves up or down along with price movement, and the Buy order is repositioned back into the corridor if it exits it. Thus, the order follows the price similarly to the MoonShot strategy.
    If set to 0, the Buy order has no corridor and does not follow the price; it remains at its initial position until executed or canceled;

  • HookPartFilledDelay: field for specifying the delay in milliseconds before canceling a partially filled Buy order.
    If 0 is set, there is no delay, and a partially filled order is immediately canceled (as in the MoonShot strategy).

  • HookSellLevel: field for specifying the SellPrice value as a percentage of the detection depth.
    For example, HookSellLevel = 75 (%) means the Sell order should be placed in the upper quarter of the spike.
    SellPrice = 100 (%) means the Sell order should be placed at the top point from which the spike started.

  • HookSellFixed: YES/NO checkbox.
    If YES is set, the Sell level is always calculated as (HookSellLevel × depth) percent, regardless of the purchase price;

  • HookReplaceDelay: field for specifying the delay in fractional seconds before moving the Buy order downward (for long) or upward (for short) after the price falls (long) or rises (short) and the Buy order exits the MoonHook corridor. After this delay, the order is moved back into the corridor (away from the current price);

  • HookRaiseWait: field for specifying the delay in fractional seconds before moving the Buy order upward (for long) or downward (for short) after the price rises (long) or falls (short) and the Buy order exits the MoonHook corridor. After this delay, the order is moved back into the corridor (closer to the current price);

  • HookRepeatAfterSell: YES/NO checkbox.
    If YES is set, a new Buy order will be placed after the Sell order is executed;

  • HookRepeatIfProfit: field for specifying the percentage of the current price relative to the purchase price above which a repeated Buy order may be placed.
    If an initial grid of Buy orders was used, only one repeated Buy order will be placed, not a full grid;

  • FastShotAlgo: YES/NO checkbox.
    If YES is set, a faster Buy order processing algorithm is activated for the MoonHook strategy. It is recommended to enable this option and control repositioning delays via the MoonReplaceDelay parameter.
    FastShotAlgo works on all exchanges, but actual acceleration depends on the specific exchange.
    Enabling this parameter slightly increases CPU load (approximately 10%).
    Behavior when FastShotAlgo = YES:

    • If HookRaiseWait = 0 → Algorithm 1 is used;

    • Otherwise → Algorithm 2 is used.
      For example, setting HookRaiseWait = 0.01 will not materially affect trading but will activate Algorithm 2.
      Algorithm 1:
      The Buy order price in MoonHook is calculated based on several recent trades.
      Algorithm 2:
      The Buy order price in MoonHook is calculated based on the minimum trade price over the last 100 ms. Side effect: this creates a built-in 100 ms “raise wait,” meaning the order cannot return earlier than 100 ms, since the minimum price over 100 ms is used instead of the current price. Thus, during those 100 ms the reference price remains equal to the minimum value, but the Buy order should move away from the price even faster.