API
This is the list of APIs that are offered through AI Strategy Builder section of the Wisdomise app
Definitions
Open condition
key
: a unique string to be used when editing a conditioncondition
: an object, showing the condition which could trigger the openamount
: a float, between 0.0 and 1.0 representing the ratio of the open orderorder_type
: a string, eithermarket
orlimit
price
: an object, showing the price iforder_type
islimit
Examples:
Condition types
True condition, which triggers immediately
Compare condition, which compares two values
type
: should be compareop
: operand, either <= or >=left
: should be price, which is equal to the current market priceright
: a float value
Close condition
key
: a unique string to be used when editing a conditionamount_ratio
: a float, between 0.0 and 1.0 showing the ratio of the current position to be closed when the condition is meetprice_exact
: a float, showing the price which triggers the close order
Example:
API
Dispatch Signal
POST
https://api.wisdomise.com/v1/strategy/signal/<signaler_id>
Headers:
Request:
Response:
An open signal opens a new position on the given pair with the given stop_loss list, take_profit list and open_orders
Position starts when the first open condition triggers, therefore open_orders
list should always be nonempty. After that each time an open condition triggers, It increases the size of the position, And for each triggered close conditions, Position's size decreases by the amount_ratio
of the triggered close condition.
For example if the current size of a position is 0.7 and a take profit with 0.5 amount_ratio
triggers, position's size will decrease to 0.35 immediately, As half of the position will be closed.
Note that
Each condition (
stop_loss
,take_profit
,open_order
) will trigger at most once, For example if price goes higher than a 120$ stop_loss, then goes lower than 120$ and again goes higher, The stop_loss only triggers at the first timeSum of
amount
s ofopen_orders
should be in the range [0.0, 1.0]No condition will trigger until the first
open_order
element triggersA position may be closed by
A signal with
close
as itsaction
Position's amount goes to zero from non-zero
Position reaches a liquidation point
When a position closes, all related limit orders will be cancelled, no conditions will be checked anymore and further
update
orclose
signal actions will be ignored until another position is created with aopen
signalAn
update
signal can be used to edit untriggered conditions, If a condition triggeres at some point, No more edit can be done to it, It should be send in the update signals without any change, Otherwise signal will be ignored with an error in the API response.
Last updated