INNER CODE UNIT · Python

target_tb_loss_value

hadialaddin/crypto-genie · crypto-genie.py:2712

                                    target_tb_loss_value = (wallet_balance - (highest_balance * (100 - initial_stop_loss_cap_ratio)/100)) if enforce_tb_sl_max_cum_loss else (wallet_balance * initial_stop_loss_cap_ratio/100)
                                    target_tb_sl_ratio = (target_tb_loss_value * 100) / position_value
                                else:
                                    wallet_balance = session.get_wallet_balance(coin=base_currency[symbol])["result"][base_currency[symbol]]["wallet_balance"]
                                    highest_balance = wallet_balance if wallet_balance > initial_equity else initial_equity
                                    target_tb_loss_value = (wallet_balance - (highest_balance * (100 - initial_stop_loss_cap_ratio)/100)) if enforce_tb_sl_max_cum_loss else (wallet_balance * initial_stop_loss_cap_ratio/100)
                                    target_tb_sl_ratio = (target_tb_loss_value * 100) / position_value

                                # Fetch latest tickers
                                try:
                                    fetched_latest_tickers = session.latest_information_for_symbol(symbol=symbol)['result']
                                except Exception:
                                    pass
                                if(fetched_latest_tickers):
                                    for ticker in fetched_latest_tickers:
                                        if ticker['symbol'] == symbol:
                                            last_price = float(ticker['last_price'])
                                            mark_price = float(ticker['mark_price'])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…