As a scalping user using limit order entry, I want the strategy to specify the entry price to the bot, so that it doesn’t fill the entry near or past my take profit level.

Community / Features & BugsCategory: FeaturesAs a scalping user using limit order entry, I want the strategy to specify the entry price to the bot, so that it doesn’t fill the entry near or past my take profit level.
Bad asked 6 months ago

Background:

The price had already moved to my take profit level by the time the market entry was placed. See screenshot. The the bot the entry 2 seconds after the start of the green candle with the yellow arrow.

Strategy Short Entry: 1332.50

Strategy Short TP: 1324.50

Exchange Short Entry Filled: 1323.60

Exchange Short TP Filled: 1324.10

Entry type: Market Order.

Inspecting the json reveals the entry price is not specified for limit orders, so even if limit order were selected, the ticket price is going to be used anyway. In this case the ticker price already moved 0.7% away from the strategy entry price.

Method to fix:

Update strategy json to specify desired entry price to bot.

If strategy json specifies market order or does not include new property for limit order, execute existing/old method (likely at ticker or or adjacent by one tick to ensure placement).

Else:

Bot get current ticker price from exchange API (not sure if the added round trip here will be a problem).

If going long and ticker is above TP minus 0.1%, place no orders.

If going short and ticker is below TP plus 0.1%, place no orders.

If going long and ticker is above specified entry price, place limit order at specified price.

If going short and ticker is at or below specified entry price, place limit order at specified price.

If going long and ticker is below specified entry price by more than 0.05%, place market order.

If going short and ticker is above specified entry price by more than 0.05%, place market order.

If going long and ticker is at or below specified entry price by less than 0.05%, place limit order at or 1 tick below current price, whatever level is required to be accepted by the exchange.

If going short and ticker is at or above specified entry price by less than 0.05%, place limit order at or 1 tick above current price, whatever level is required to be accepted by the exchange.

Attachments

Liked it? Take a second to support on Patreon!
Become a patron at Patreon!