vendredi 28 juillet 2023

How to install chrome on a non graphical Linux ?

 This is for using chrome in an headless version in order, for example, to run tests on an angularjs app...


# Ajouter la clé GPG du dépôt Google Chrome

wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -


# Ajouter le dépôt Google Chrome aux sources de paquets

sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'



sudo apt-get update

sudo apt-get install google-chrome-stable




vendredi 16 décembre 2022

How to send an OCO Order to Binance in Python ?

 #Open_position_order function on Binance

def open_position_order(symbol,quantity, side, order_type = ORDER_TYPE_MARKET):

    try:
        print("sending order")
        order = client.create_order(
        symbol=symbol,
        side=side,
        type=order_type,
        quantity=quantity)
   
        print(order)
       
    except Exception as e:
        print('open position order error')
        return False
   
    return True


You might need to install the following dependency :
pip install python-binance

jeudi 15 décembre 2022

Exemple pyinstaller

 pyinstaller.exe --onefile MyPythonScript.py

The Windows executable file will then be created in the "dist" directory.

mercredi 14 septembre 2022

What about mining NERVA ?

 I was surfing Twitter and found out that a new cryptocurrency was mined : NERVA.

NERVA seems to be a fork of Monero (XMR).

As I'm already mining XMR, I'll try to mine NERVA also.

Here are the websites that could help you starting to mine NERVA :

https://nerva.one/#mining

https://www.cryptunit.com/miner/NERVA-Miner

Happy mining !

Coding a strategy with PineScript v5

 Here are the very basics that will help you get started with coding a strategy in PineScript v5 (The programming language on Tradingview) :


//@version=5

strategy("test", initial_capital=500)

if open>close[1]

    strategy.entry("Long", strategy.long, 1000)

    //strategy.entry("sell", strategy.short, 1)

    strategy.exit("Exit", "Long", profit = 100, loss = 100)

plot(strategy.equity)


For those who are interested of the details of this very simple strategy : It checks if the current close price is greater than the previous open price and in that case it buy a quantity of 1000 and will sell when the price is 100 points higher.

Eg. on CHZUSDT in 15-minutes timeframe, it could open the following trade :