Работа завершена
Техническое задание
This is a simple buying and selling bot.
Here are the user inputs I want:
-
Max order: I need to be able to specify the maximum number of orders the bot should open.
-
Risk: I need to be able to set the percentage of my capital to use on each trade.
-
Stop loss (in points): I need to be able to set the distance in points between the entry price and stop loss. For example, if the entry price is 2002, the stop loss (in points) should be X points away from the entry. To calculate the size of the order, the bot should use the specified number of points in the stop loss (in points), along with the entry price (which should always be the closing price of the last candle), and the defined risk percentage in Risk.
-
Direction: I need to be able to specify whether the bot should only look for sell opportunities or only for buy opportunities.
-
Target Multiplier: A straightforward numerical value used to calculate the target.
Sell condition:
The bot will initiate a sell order if the candle closes bearish on the timeframe he was set. It must set an order at the closing price. For example, if the closing price is 2002, the bot should place a sell order at 2002. Importantly, every order must be accompanied by both a stop loss and a take profit.
The stop loss: The stop loss should be calculated using the entry price, which is the closing price of the last bearish candle, and the specified number of points. For instance, if the order is taken at 2002, and the specified number of points for the stop loss I specified is 1000, the stop loss should be set to 1000 points away from 2002 (the entry price). The ability to set the number of points for the stop loss should be available as a user input.
The target: To calculate the target, the bot should take the Stop loss (in points) and multiply it by the number specified in Target Multiplier to set the target. Example, if I put in … 2.5 and in … 1000 points, the profit should be 2500 points away from the entry price.
Entry: Always set a pending order at the closing price of the bearish candle and not market order at the close. Example, if the price closes at 2002, the pending order is 2002.
Buy condition: The same as sell condition but inverted.