Firetron’s InputOrderOptions with reduceOnly hiddenOrder

0 118 Views No Comments 4 months ago
HTS 3.XSTABLE
  • updated Firetron’s InputOrderOptions
    https://www.haasscripts.com/t/firetrons-inputorderoptions/
    to include
    9. reduceOnly – Boolean – (Optional)
    Ensures that the executed order does not flip the opened position.

    10. hiddenOrder – Boolean – (Optional)
    The hidden order option ensures an order does not appear in the order book.

    Test script:

    
    if not Load('done', false) then
    
      -- Test Long Order
    
      Log('==================================================')
      Log('Testing Long Order: ')
      Log('==================================================')
    
      local longOptions = CC_InputOrderOptionsV4('Long Order')
    
      Log(longOptions.price)
      Log(longOptions.amount)
      Log(longOptions.market)
      Log(longOptions.type)
      Log(longOptions.note)
      Log(longOptions.positionId)
      Log(longOptions.timeout)
      Log(longOptions.triggerPrice)
      Log(longOptions.reduceOnly)
      Log(longOptions.hiddenOrder)
    
      local longParams = {
        market = longOptions.market,
        type = longOptions.type,
        note = longOptions.note,
        positionId = longOptions.positionId,
        timeout = longOptions.timeout,
        triggerPrice = longOptions.triggerPrice,
        reduceOnly = longOptions.reduceOnly,
        hiddenOrder = longOptions.hiddenOrder
      }
    
      PlaceGoLongOrder(longOptions.price, longOptions.amount, longParams)
    
      -- Test Short Order
    
      Log('==================================================')
      Log('Testing Short Order')
      Log('==================================================')
    
      local shortOptions = CC_InputOrderOptionsV4('Short Order')
    
      Log(shortOptions.price)
      Log(shortOptions.amount)
      Log(shortOptions.market)
      Log(shortOptions.type)
      Log(shortOptions.note)
      Log(shortOptions.positionId)
      Log(shortOptions.timeout)
      Log(shortOptions.triggerPrice)
      Log(shortOptions.reduceOnly)
      Log(shortOptions.hiddenOrder)
    
      local shortParams = {
        market = shortOptions.market,
        type = shortOptions.type,
        note = shortOptions.note,
        positionId = shortOptions.positionId,
        timeout = shortOptions.timeout,
        triggerPrice = shortOptions.triggerPrice,
        reduceOnly = shortOptions.reduceOnly,
        hiddenOrder = shortOptions.hiddenOrder
      }
    
      PlaceGoShortOrder(shortOptions.price, shortOptions.amount, shortParams)
    
      Save('done', true)
    
    end
    
    
    • This topic was modified 4 months, 1 week ago by Team HaasScripts.
    • This topic was modified 4 months ago by Kobalt.
    • This topic was modified 4 months ago by Kobalt. Reason: noticed two entries made one v3 compatible
    • This topic was modified 4 months ago by Kobalt. Reason: noticed two entries made one v3 compatible
    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