Code Monkey home page Code Monkey logo

Comments (8)

mvthul avatar mvthul commented on May 30, 2024 1

from tradingview-webhook-trading-bot.

mvthul avatar mvthul commented on May 30, 2024 1

from tradingview-webhook-trading-bot.

lth-elm avatar lth-elm commented on May 30, 2024

Hello, the leverage is calculated according the risk and the position (enter price & SL price) so you don't have to define it since it will calculate itself, but indeed it is possible to write the risk inside the POST request, then in your flask application you would need to consider it instead of the ENV variable defined.

Regarding the APIKEY and APISECRET it's a bad idea to put it there, security wise.

from tradingview-webhook-trading-bot.

lth-elm avatar lth-elm commented on May 30, 2024

Wow great yeah I'd love to see what you can build around

from tradingview-webhook-trading-bot.

mvthul avatar mvthul commented on May 30, 2024

from tradingview-webhook-trading-bot.

lth-elm avatar lth-elm commented on May 30, 2024

size = (free_collateral * self.risk) / abs(payload['price'] - stop_loss)

This is already coded, the risk variable initially retrieved within the environment variable should just be replaced by the one inside the POST request.

from tradingview-webhook-trading-bot.

mvthul avatar mvthul commented on May 30, 2024

from tradingview-webhook-trading-bot.

lth-elm avatar lth-elm commented on May 30, 2024

Hi you made the images that's cool.

I'm actually quite busy with other projects right now however I can share with you some knowledge.

First like I told you you don't need to specify the leverage if you are already specifying the risk you want to take. If you want to buy BTC with 250 USDT at 20000$ and cut your losses so that you lose 62.50 USDT if the price hit 19000$ that would require you to trade with a leverage of 5, not 50, not 25. This calculation is made automatically inside the code and does not need to be changed. A trader doesn't adjust his leverage according to his desires but according the risk he want to take per trade.

If you're new to trading and this concept of leverage is not clear I advise you to learn first about trading as you will also encounter many (bad) surprises if not.

If you want to use testnet or livenet through payload keys you don't need to change anything since it is already the case. Your subaccount key is either linked to a testnet or a livenet account.

from tradingview-webhook-trading-bot.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.