TrExEn: Trade Execution Engine
Contact:
Telegram: @neontele @JordyATS
Discord: Trexen#4779
Discord:
http://discord.gg/7bC529u
Telegram:
https://t.me/ATSbotscriptsupport
Signal Channels:
Channel: @ATSsignalsfree
Telegram: @ATSsignalsfreechat
Quickstart video:
https://www.youtube.com/watch?v=nUGkgMgqhq0
Video Playlist:
https://www.youtube.com/watch?v=rHggf0Etm9Q&t=0s&index=5&list=PLv6IfA-tJ0jP4I_YJiaQVp0KE0lz-hwOj
=====Example Bitmex Order Sets=====
BTC_LONG/BTC_SHORT:
Opens a position with 3 Limit Orders, 3 Take Profit Market orders, and a full Stop Market.
Limit orders take up a maximum of 10% of the account value.
TP Market orders take 10%, 15%, and 25% of the entire position. TP Market orders do not care if the limit orders fully fill or not, so a position may potentially be closed out completely if not all limit orders fill.
This Order Set would be used for opening a position when no position is open.
BTC_LONG_CLOSE/BTC_SHORT_CLOSE:
Closes the open position with a reduce-only Limit Close and a Stop Market order, in an attempt to reduce fees with a Limit while guaranteeing the position will still close with the Stop.
BTC_TP:
Demonstrates that a side parameter is not required. This order will close 25% of the open position with a reduce-only Limit Close order on bid or ask, regardless if long or short.
Also note that Limit Close sizing is different from TP Market.
Limit Close bases the quantity as a percentage of the currently open position, at the time the Limit Close order is calculated. If 100 contracts are open, a Limit Close of 25% will close 25 contracts.
TP Market bases the quantity off of the Max Position. If the account at current leverage can afford a maximum of 1000 contracts, "Max Position" is set to 20%, and "Position Size" is set to 33%, the TP Market order will place an order for 1000 * 20% * 33% = 66 contracts.
BTC_LONG_SWITCH/BTC_SHORT_SWITCH:
Used for switching from short to long, or long to short. This is a multi-part order.
The first part of the order is simply the same as the orderset found in BTC_XXX_CLOSE
The second part of the order is tagged with "Wait For Close," which will wait for the opposite position to close first before executing the orders tagged with "Wait For Close."
Trexen knows which orders need to be separated and in what order they need to be executed in.
===ADVANCED TERRITORY===
BTC_LONG_SWITCH_POT/BTC_SHORT_SWITCH_POT:
Similar to the previous order set, but instead of entering 100% of the position at once, only enters in 25%.
Also, the addition of a Price Order Trigger (POT) order. The POT order will execute the specified "Payload" order when the price is reached. In this case, the one of the POT payloads is the same Order Set.
If price moves 0.25% against entry, all unfilled orders will be cleared from the books and this same Order Set (BTC_XXX_SWITCH_POT) will be repeated.
Since the initial position is set to 1/4 of the specified Max Position, this orderset will only be able to add to the position 3 more times if price immediately moved against the position.
If the Limit Close orders fill, it will free up more capital and allow this order to average itself down further if needed.
You will notice that this orderset contains other POT payloads that reference the following ordersets:
BTC_XXX_TP_RECALC:
Since during BTC_XXX_SWITCH_POT we entered with a Limit Order with "Wait" enabled, it was able to wait for the position to close in order to calculate the Limit Close order quantities.
If BTC_XXX_SWITCH_POT is executed more than once, the "Wait" condition wouldn't do anything, because the opposite position is already closed, and the new Limit Close orders would immediately calculate their quantities based on the current open position, without factoring in the new 25% Limit entry we averaged down/up with.
As a solution, this order is attached to a POT slightly below our last Limit entry to ensure once our new Limit entry fills, we will recalculate the Limit Close quantities including the new contracts we averaged down/up with.
BTC_XXX_SECURE:
This is set to trigger 1% in profit from the last entry. Once we have risen 1%, a Break-Even stop is placed to "secure" our trade and ensure we don't lose any of our closed profits.
=====Special Order Types=====
Break-Even (BE) Stop:
Places a stop market on average entry. If a Relative Price % is specified, it will place the stop in profit by the specified %.
Limit Close:
Will close a % of the open contracts. Does not have visibility into other orders in the same Order Set. If that is desired, use POT orders.
Price Order Trigger (POT):
When the specified price is reached, the Order String or Order Set specified in the "Payload" will be calculated/executed.
This is one of the most powerful orders available, and enables the user to do complex, even recursive order logic. The possibilities are endless.
Some examples:
-A POT used as a TP order that contains a Payload of a Limit Close and a Break-Even Stop. Further TP targets can contain POT orders that do the same, but increase the % specified on the Break-Even Stop to secure more profits.
-A self sustaining order in a parallel channel. If price is ranging within 1%
Order_A: Close previous position, Limit/Market enter, POT order with Price = 1% above, Payload = Order B.
Order_B: Close previous position, Limit/Market enter, POT order with Price = 1% below, Payload = Order A.
=====Special Order Attributes=====
Trail:
When enabled on a Stop, will simply use Bitmex's native trailing system.
When enabled on a Limit order, Trexen will automatically amend the price of the Limit order every 3sec, if necessary.
Trails can be applied to Stop, Limit, Limit Close, and POT order.
Wait For Close:
When applicable, will wait for the opposite position to close before placing orders tagged with "Wait." Used for switching positions immediately from long to short or short to long. See BTC_XXX_SWITCH for an example.