-
Creates a spread of orders.
Custom Command Dependencies:
NoneTest Script:
if not Load('done', false) then local currentPrice = CurrentPrice()[1] -- Test Long Spread Log('==================================================') Log('Testing Long Spread, CurrentPrice: '..currentPrice) Log('==================================================') local p = { amountList = {1, 2, 3}, direction = 'GoLong', orderOptions = { market = PriceMarket(), type = NoTimeOutOrderType, note = 'Long Spread', }, priceList = {currentPrice, SubPercentage(currentPrice, 1), SubPercentage(currentPrice, 1)}, } local longOrders = CC_PlaceSpreadOrder(p) for i = 1, #longOrders do Log('Long Order ID: '..longOrders[i]) end -- Test Short Spread Log('==================================================') Log('Testing Short Spread, CurrentPrice: '..currentPrice) Log('==================================================') p.direction = 'GoShort' p.orderOptions.note = 'Short Spread' p.priceList = {currentPrice, AddPercentage(currentPrice, 1), AddPercentage(currentPrice, 1)} local shortOrders = CC_PlaceSpreadOrder(p) for i = 1, #shortOrders do Log('Short Order ID: '..shortOrders[i]) end Save('done', true) end