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 :






vendredi 26 août 2022

How to install TA-Lib on Ubuntu (and on GitPod.io...) ?

Here is the link to the documentation that helped me a lot, and thanks to it TA-Lib was installed in less than 5 minutes (I was installing FreqTrade and an error about the ta-lib installation were shown) :

https://blog.quantinsti.com/install-ta-lib-python/

Here I write the lines that helped me (in case the link above were suppressed) :


sudo apt-get -y install gcc build-essential


wget -O inst_conda.sh "https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh" \

  && /bin/bash inst_conda.sh -b \

  && rm inst_conda.sh \

  && ./anaconda3/bin/conda init \

  && source ~/.bashrc \

  && conda create -n quantra python=3.6.8 -y \

  && conda activate quantra


wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz \

  && sudo tar -xzf ta-lib-0.4.0-src.tar.gz \

  && sudo rm ta-lib-0.4.0-src.tar.gz \

  && cd ta-lib/ \

  && sudo ./configure --prefix=/usr \

  && sudo make \

  && sudo make install \

  && cd ~ \

  && sudo rm -rf ta-lib/ \

  && pip install ta-lib


jeudi 28 avril 2022

VMWare Bridge Connection (How to resolve)

 On windows :

C:\Program Files (x86)\VMware\VMware Player>vnetlib64.exe -- install bridge


jeudi 7 avril 2022

WslRegisterDistribution error on Windows 10

I often get this error while trying to launch Ubuntu on Windows WSL (command "ubuntu2004"). 


"Installing, this may take a few minutes...

WslRegisterDistribution failed with error: 0x80080005

Error: 0x80080005 ╔chec de l?exÚcution du serveur

Press any key to continue..."


mercredi 6 avril 2022

Install VNC Server on AWS Ubuntu Linux (For accessing a graphical environment)

Here is the link that will help you for doing that :

https://ubuntu.com/tutorials/ubuntu-desktop-aws#1-overview

Then from a Windows machine, download TightVNC at :

https://www.tightvnc.com/download.php

And when entering the remote AWS Ubuntu machine address in TightVNC, don't forget to append "::5901" at the end of the URL.


If you want to change the displayed resolution when connecting from TighVNC client, then, on the Ubuntu Linux machine do the following :

vncserver -kill :1

vncserver -geometry 1600x1200

And connect again from your TightVNC client on the remote (Windows) machine.


mardi 5 avril 2022

Find large files in command-line (WSL/Ubuntu 2004)

 find / -name * 2>/dev/null -type f -size +1000000


Ideas for troubleshooting WSL/Ubuntu2004 (LxssManager service)

 If you try to start your Ubuntu 20.04 LTS instance in the WSL environment on Windows (10), then try to restart the LxssManager service through Powershell as follows :

powershell

Restart-Service LxssManager

Restart-Service LxssManager -force

The following article might help to understand the mechanics around starting and stopping services through Powershell, in case you need it :

https://social.technet.microsoft.com/Forums/windows/en-US/574d175f-c370-4bd5-9bf1-c5e400362dfa/powershell-script-to-restart-a-service-and-its-dependents-and-their-dependents?forum=ITCG

Basically, you should use the "Get-Service" function to list all services from Powershell.


jeudi 31 mars 2022

Transmettre un signal radio AM depuis un PC sans aucun périphérique hardware !

En faisant une recherche sur la documentation NFT EIP721 je suis tombé sur la page suivante :

https://eips.ethereum.org/EIPS/eip-721

Un est auteurs est un certain William Entriken, et quand on clique sur son nom dans le document EIP721, on arrive sur un repository GitHub sur lequel on peut voir un projet "System-Bus-Radio".

https://github.com/fulldecent/system-bus-radio

Ce projet permets de jouer une petite mélodie qui est transmise sur une fréquence radio AM de 1580 Khz uniquement en faisant appel à des instructions du processeur !!!

Hallucinant !

Pour celles et ceux qui s'intéressent à ce sujet, voici un PDF à lire, qui a été déclassifié à la NSA en 2007 :

https://www.nsa.gov/portals/75/documents/news-features/declassified-documents/cryptologic-spectrum/tempest.pdf

Le titre de ce PDF est "TEMPEST: A Signal Problem The story of the discovery of various compromising radiations from communications and Comsec equipment."

Bonne lecture !


mercredi 30 mars 2022

How to view WSL Ubuntu 20.04 Linux files from the Windows Explorer ?

From the Ubuntu shell prompt, enter :

explorer.exe .

That will open a Windows Explorer pointing to your current shell's directory, such as :

\\wsl$\Ubuntu20.04LTS\home\ubuntu

vendredi 25 mars 2022

Example for XMRIG command line for mining XMR (Monero) on a pool

 sudo ./xmrig --donate-level 1 -o xmr-eu1.nanopool.org:14444 -u YOURWALLET.YourWorkerID/YourEmailAddress -k --coin monero -a rx/0


How to install XMRIG on an Amazon EC2 Ubuntu Server 20.04 LTS ?

 Original article here :

https://levelup.gitconnected.com/profitability-of-cpu-mining-the-cryptocurrency-monero-on-aws-ec2s-5a3ae3df2be4

Here is the main procedure :

sudo apt-get update
sudo apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
git clone https://github.com/xmrig/xmrig.git
mkdir xmrig/build && cd xmrig/build
cmake ..
make -j$(nproc)


mercredi 9 mars 2022

Menu secret MICOM Renault sur Medianav Evolution 9.3.1

Voici une vidéo montrant comment accéder au menu secret sur les voitures Renault équipées du système Médianav Evolution 9.3.1




mercredi 23 février 2022