Firetron’s InputOrderOptions

1 120 Views No Comments 4 months ago
  • Creates a group of inputs for order options.

    Custom Command Dependencies:
    None

    Test Script:

    if not Load('done', false) then
    
      -- Test Long Order
    
      Log('==================================================')
      Log('Testing Long Order: ')
      Log('==================================================')
    
      local longOptions = CC_InputOrderOptions('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)
    
      local longParams = {
        market = longOptions.market,
        type = longOptions.type,
        note = longOptions.note,
        positionId = longOptions.positionId,
        timeout = longOptions.timeout,
        triggerPrice = longOptions.triggerPrice,
      }
    
      PlaceGoLongOrder(longOptions.price, longOptions.amount, longParams)
    
      -- Test Short Order
    
      Log('==================================================')
      Log('Testing Short Order')
      Log('==================================================')
    
      local shortOptions = CC_InputOrderOptions('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)
    
      local shortParams = {
        market = shortOptions.market,
        type = shortOptions.type,
        note = shortOptions.note,
        positionId = shortOptions.positionId,
        timeout = shortOptions.timeout,
        triggerPrice = shortOptions.triggerPrice,
      }
    
      PlaceGoShortOrder(shortOptions.price, shortOptions.amount, shortParams)
    
      Save('done', true)
    
    end
    • This topic was modified 2 months, 1 week ago by Firetron. Reason: Added the other parameters. Added test script
    • This topic was modified 2 months, 1 week ago by Firetron. Reason: Updated description
    • This topic was modified 2 months ago by Firetron. Reason: Changed numeric defaults to -1 so timeout won't override notimeout orders
    HaasScript Code
    Sign in or Register to view
Login or Register to Comment

Unlock your crypto trading potential

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

Join for Free