Signals

The Signal endpoints enable your bot to send and manage signals. A signal is a mini-strategy that allows your bot to define an entry point, close targets and stop-loss level. BEM will generate the corresponding orders and send them to the exchange at the appropriate time.

[POST] placeSignal

Description

Send a signal to the platform

Parameters

(Body)

Name Type Description Mandatory
signalProvider string Name of the Bot Yes
signalProviderKey string Secret key Yes
extId string ID generated by bot. Please note that the ID should be unique. Signals with non-unique extIds will be rejected. Yes
exchange string Target exchange for the signal Yes
baseAsset string Base asset of the signal Yes
quoteAsset string Quote asset of the signal Yes
direction string ‘buy2sell’ or ‘sell2buy’ Yes
openLimitPrice string The level at which to open the position Yes
openQtyPct string The percentage of available asset to use Yes
openQtyAbs string Absolute value to use Only Internal
openTtlType string Time To Last type for the opening order, ‘gtc’ or ‘secs’ Yes
openTtlSecs string Time To Last seconds Yes if type = ‘secs’
closeTargets [CloseTarget] Array of CloseTargets Yes
closeTtlType string Time to Last type for close orders, ‘gtc’ or ‘secs’ Yes
closeTtlSecs string Time to Last seconds if type = ‘secs’ Yes if type = ‘secs’
slLimitPricePct string Stoploss order limit as pct of openLimitPrice (e.g. 98.5) No
slLimitPriceAbs string Absolute value stoploss order limit price No
slStopPricePct string Stop loss trigger level as pct of openLimitPrice (e.g. 99) No
slStopPriceAbs string Stop loss trigger level as absolute value No

CloseTarget

Name Type Description Mandatory
qtyPct string Percentage to close Yes
limitPricePct string Percentage of average execution price of opening order (e.g. 105) Yes
limitPriceAbs string Absolute price level Only Internal

Example

curl -X POST "https://signal.revenyou.io/paper/api/signal/v2/placeSignal" -H  "accept: application/xml" -H  "Content-Type: application/json" -d "{  \"signalProvider\": \"MyBot\",  \"signalProviderKey\": \"MyKey\",  \"extId\": \"0001\",  \"exchange\": \"binance\",  \"baseAsset\": \"BTC\",  \"quoteAsset\": \"USDT\",  \"direction\": \"buy2sell\",  \"openLimitPrice\": \"40000\",  \"openQtyPct\": \"60\",  \"openTtlType\": \"gtc\",  \"closeTargets\": [    {      \"qtyPct\": \"100\",      \"limitPricePct\": \"105\"    }  ]}"

Response

Name Type Description Mandatory
successs string ‘true’ or ‘false’ Yes
id string BEM generated signal id Yes if successs = true
status string pending / beingExecuted / beingCanceled / executed / canceled / rejected Yes
stage string open / takeProfit / tp2sl (from take profit to stoploss) / stopLoss Yes
rejReason string No

[POST] cancelSignal

Description

Cancel an active signal

Parameters

(Body)

Name Type Description Mandatory
signalProvider string Name of the Bot Yes
signalProviderKey string Secret key Yes
signalId string Unique ID generated by BEM Yes or extId
extId string Unique ID generated by bot Yes or signalId

Example

curl -X POST "https://signal.revenyou.io/paper/api/signal/v2/cancelSignal" -H  "accept: application/xml" -H  "Content-Type: application/json" -d "{  \"signalProvider\": \"MyBot\",  \"signalProviderKey\": \"MyKey\",  \"signalId\": \"BEMId_001\",  \"extId\": \"MyId_001\"}"

Response

Name Type Description Mandatory
success string ‘true’ or ‘false’ Yes

[GET] getSignalState

Description

Retreive the current state of a specific signal

Parameters

(Query)

Name Type Description Mandatory
signalProvider string Name of the Bot Yes
signalProviderKey string Secret key Yes
signalId string Unique ID generated by BEM Yes or extId
extId string Unique ID generated by bot Yes or signalId

Example

curl -X GET "https://signal.revenyou.io/paper/api/signal/v2/getSignalState?signalProvider=MyBot&signalProviderKey=MyKey&signalId=BEMId_001&extId=MyId_001" -H  "accept: application/xml"

Response

Name Type Description Mandatory
success string ‘true’ or ‘false’ Yes
id string BEM generated signal id Yes if success = true
status string pending / beingExecuted / beingCanceled / executed / canceled / rejected Yes
stage string open / takeProfit / tp2sl (from take profit to stoploss) / stopLoss Yes
rejReason string No

[GET] getSignalInfo

Description

Retreive complete info on a specific signal

Parameters

(Query)

Name Type Description Mandatory
signalProvider string Name of the Bot Yes
signalProviderKey string Secret key Yes
signalId string Unique ID generated by BEM Yes or extId
extId string Unique ID generated by bot Yes or signalId

Example

curl -X GET "https://signal.revenyou.io/paper/api/signal/v2/getSignalInfo?signalProvider=MyBot&signalProviderKey=MyKey&signalId=BEMId_001&extId=MyId_001" -H  "accept: application/xml"

Response

Name Type Description Mandatory
success string ‘true’ or ‘false’ Yes
id string BEM generated signal id Yes if success = true
extId string Unique ID generated by bot Yes or signalId
signalProvider string Name of the Bot Yes
exchange string Target exchange for the order Yes
baseAsset string Base asset of the order Yes
quoteAsset string Quote asset of the order Yes
direction string ‘buy2sell’ or ‘sell2buy’ Yes
status string pending / beingExecuted / beingCanceled / executed / canceled / rejected Yes
stage string open / takeProfit / tp2sl (from take profit to stoploss) / stopLoss Yes
rejReason string No
openLimitPrice string Yes
openQtyPct string Yes
openTtlType string ‘gtc’ or ‘secs’ Yes
openTtlSecs string Present if type = ‘secs’ if type = ‘secs’
openOrder Order Object Associated order if present No
closeTargets Close Target object Associated CloseTargets Yes
closeTtlType string ‘gtc’ or ‘secs’ Yes
closeTtlSecs string Number of seconds if type = ‘secs’ if type = ‘secs’
slIsDefined string Signals if stoploss is defined; ‘yes’ or ‘no’ Yes
slLimitPriceIsAbs string Is limit price abs or pct Yes if slIsDefined
slLimitPriceVal string Limit price value Yes if slIsDefined
slStopPriceIsAbs string Is stop price abs or pct Yes if slIsDefined
slStopPriceVal string Stop level value Yes if slIsDefined
slOrder Order object The stop loss order associated with this signal No
baseFree Asset Info object No
quoteFree Asset Info object No
baseLocked Asset Info object No
quoteLocked Asset Info object No

Asset Info

Name Type Description Mandatory
exchange string Exchange of this asset Yes
asset string Yes
signalId string Yes
orderId string Yes
amount string Yes
amountBase string Yes

[GET] getSignals

Description

Retreive all signals from a bot

Parameters

(Query)

Name Type Description Mandatory
signalProvider string Name of the Bot Yes
signalProviderKey string Secret key Yes

Example

curl -X GET "https://signal.revenyou.io/paper/api/signal/v2/getSignals?signalProvider=MyBot&signalProviderKey=MyKey" -H  "accept: application/xml"

Response

Name Type Description Mandatory
success string ‘true’ or ‘false’ Yes
signals [SignalInfos] See getSignalInfo response Yes