INNER CODE UNIT · Python

Sell_req

Mo-Khalifa96/Forex-Trading-Bot · OrderProcessing.py:65

def Sell_req(symbol, entryp, max_val, avg_val):
    '''This function creates and returns a sell request.'''

    #Get lot amount
    lot = get_lot(mt5.account_info()._asdict()['balance'])
    #Double the lot if price is closer to the average line
    if entryp <= np.mean([max_val, avg_val]):
        lot = round(lot*2,2)
    
    #Get decimals for current symbol
    decimals = (5 if 'JPY' not in symbol else 3)

    #Create sell request
    req = {
    'action': mt5.TRADE_ACTION_DEAL,
    'symbol': symbol,
    'volume': lot,
    'type': mt5.ORDER_TYPE_SELL,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…