Trade
- easyT.trade.get_trade(log: supportLibEasyT.log_manager.LogManager, platform, symbol: str, lot: float, stop_loss: float, take_profit: float)[source]
This function return the class that responsible is responsible to handle all the trade requests
It is allowed to have only one position at time per symbol, right now it is not possible to open a position and increase the size of it or to open opposite position. Open an open position will close the other direction one.
- Parameters
log –
The log receives a log handler to be able to log the information
- platform:
It is the platform that the information will be returned.
- symbol:
It is the symbol you want to open or close or check if already have an operation opened.
- lot:
It is how many shares you want to trade, many symbols allow fractions and others requires a certain amount. It can be 0.01, 100.0, 1000.0, 10000.0.
- stop_loss:
It is how much you accept to lose. Example: If you buy a share for US$10.00, and you accept to lose US$1.00 you set this variable at 1.00, you will be out of the operation at US$9.00 (sometimes more, somtime less, the US$9.00 is the trigger). Keep in mind that some symbols has different points metrics, US$1.00 sometimes can be 1000 points.
- take_profit:
It is how much you accept to win. Example: If you buy a share for US$10.00, and you accept to win US$1.00 you set this variable at 1.00, you will be out of the operation at US$11.00 (sometimes more, somtime less, the US$11.00 is the trigger). Keep in mind that some symbols has different points metrics, US$1.00 sometimes can be 1000 points.
- Returns
It returns the right class that will be used or an error message in case it was not found
- Return type
The class or Error message