Need help of an algos dev

factoflife

Newbie
Messages
9
Likes
0
Hello

Do you know of an advanced open-source/free online solution (I don't have a lot of money) for creating trading strategies for decentralized exchanges, including Bitget?

Or are there devs who specialize in this?

Ideally, I'd like to find a dev with whom we can get along with an exchange of good practices: he will be entitled to a percentage of my trading earnings made thanks to our collaboration.

In fact, I would like to automate the taking of positions according to specific conditions when my future pairs screener displays pairs which meet these latter, this would save me from doing it manually because it is not sufficiently optimized and precise. So you have to code in python and enter the API data etc.

The most complicated thing is finding user-friendly support that allows you to do this without typing command lines...

(I could certainly do it on a Linux server using secure shell in python but I don't know everything anymore...)

Thanks in advance if you have any leads 🙏

(If you are fluent in French, the dialogue would be simplified as I am French)
 
Hello,

I tried to code something for PineScript but it seems to be javascript and PineScript doesn't recognize it. Could someone who knows anything about this please help me?

Thanks in advance


Code:
//@version=5
indicator("Custom Screener", overlay=true)

// Fonction pour récupérer la paire la plus liquide
getMostLiquidPair(futuresPairs) =>
    mostLiquidPair = ""
    highestVolume = 0

    // Parcours des paires futures
    for i = 0 to (array.size(futuresPairs) - 1)
        // Récupération du volume actuel de la crypto-monnaie future (Note: Volume might not be accurate for futures)
        currentVolume = request.security(futuresPairs[i], "1D", close)

        // Si le volume actuel est plus élevé que le plus élevé enregistré jusqu'à présent
        if (currentVolume > highestVolume)
            // Met à jour la paire la plus liquide et le volume le plus élevé
            highestVolume := currentVolume
            mostLiquidPair := futuresPairs[i]

    // Retourne la paire la plus liquide
    mostLiquidPair

// Liste des paires futures
futuresPairs = ["BTCUSDTPERP", "ETHUSDTPERP", "XRPUSDTPERP"] // Adjust with your futures pairs

// Récupération de la paire la plus liquide pour les futures
mostLiquidPair = getMostLiquidPair(futuresPairs)

// Paramètres du screener Bitget Futures
priceIncreaseThreshold = 0.05
macdThreshold = 0.2
macdTimeframe = "1"

// Fonction de trading Bitget Futures
buy(mostLiquidPair) =>
    // Vérifie si nous ne sommes pas actuellement en position
    if (strategy.marketposition == 0)
        // Récupération des données de la crypto-monnaie Bitget Futures
        symbolData = ta.info(mostLiquidPair)

        // Calcul de la variation sur différentes périodes depuis l'ouverture de la bougie Bitget Futures
        performance1m = close / request.security(mostLiquidPair, "1M", close)[1] - 1
        performance3m = close / request.security(mostLiquidPair, "3M", close)[1] - 1
        performance5m = close / request.security(mostLiquidPair, "5M", close)[1] - 1
        performance30m = close / request.security(mostLiquidPair, "30M", close)[1] - 1

        // Calcul de la moyenne des performances sur les différentes périodes
        avgPerformance = (performance1m + performance3m + performance5m + performance30m) / 4

        // Comparaison des valeurs actuelles aux seuils Bitget Futures
        symbolMeetsPriceIncreaseThreshold = performance1m > priceIncreaseThreshold
        symbolMeetsMACDThreshold = ta.crossover(ta.macd(macdTimeframe, mostLiquidPair, close), ta.sma(ta.macd(macdTimeframe, mostLiquidPair, close), 9))

        // Si la crypto-monnaie Bitget Futures répond à tous les critères
        if (symbolMeetsPriceIncreaseThreshold and symbolMeetsMACDThreshold)
            // Place un ordre d'achat pour la paire la plus liquide des futures
            strategy.entry("Buy", strategy.long, symbol=mostLiquidPair)

            // Définit le trailing stop pour la paire la plus liquide des futures
            trailingStop = close - close * 0.04

// Appel de la fonction buy Bitget Futures
buy(mostLiquidPair)
 
Last edited:
I want to convert this Javascript code to PineScript for TradingView. I'm pretty new to the code, I don't know how to do it...
 
"ChatGPT convert the following JavaScript to TradingView Pine Script" outputs the code below.

Caveat: I have not checked it. Don't run it (especially, don't use it for a trading decision) unless you have checked it and understand it. My general experience of ChatGPT code output is it's usually close but not perfectly correct. It's unlikely to be correct "out of the box".

I'm a professional developer, DM me if you want to talk further.

or fire up ChatGPT, dig in and figure it out. There is no secret sauce to coding, just a combination of moderate aptitude and some determination.

//@version=5
indicator("Custom Screener", overlay=true)

// Function to get the most liquid pair
getMostLiquidPair(futuresPairs) =>
mostLiquidPair = ""
highestVolume = 0

// Loop through futures pairs
for i = 0 to (array.size(futuresPairs) - 1)
// Get current volume for the future cryptocurrency (Note: Volume might not be accurate for futures)
currentVolume = request.security(futuresPairs, "1D", close)

// If current volume is higher than the highest recorded so far
if (currentVolume > highestVolume)
// Update the most liquid pair and highest volume
highestVolume := currentVolume
mostLiquidPair := futuresPairs

// Return the most liquid pair
mostLiquidPair

// List of futures pairs
futuresPairs = ["BTCUSDTPERP", "ETHUSDTPERP", "XRPUSDTPERP"] // Adjust with your futures pairs

// Get the most liquid pair for futures
mostLiquidPair = security(syminfo.tickerid, "1D", getMostLiquidPair(futuresPairs))

// Screener parameters for Bitget Futures
priceIncreaseThreshold = 0.05
macdThreshold = 0.2
macdTimeframe = "1"

// Function for Bitget Futures trading
buy(mostLiquidPair) =>
// Check if we are not currently in a position
if (strategy.marketposition == 0)
// Get data for Bitget Futures cryptocurrency
symbolData = request.security(mostLiquidPair, "1D", close)

// Calculate performance over different periods since the opening of the Bitget Futures candle
performance1m = close / request.security(mostLiquidPair, "1M", close)[1] - 1
performance3m = close / request.security(mostLiquidPair, "3M", close)[1] - 1
performance5m = close / request.security(mostLiquidPair, "5M", close)[1] - 1
performance30m = close / request.security(mostLiquidPair, "30M", close)[1] - 1

// Calculate the average performance over different periods
avgPerformance = (performance1m + performance3m + performance5m + performance30m) / 4

// Compare current values to Bitget Futures thresholds
symbolMeetsPriceIncreaseThreshold = performance1m > priceIncreaseThreshold
symbolMeetsMACDThreshold = crossover(ta.macd(mostLiquidPair, close), ta.sma(ta.macd(mostLiquidPair, close), 9))

// If Bitget Futures cryptocurrency meets all criteria
if (symbolMeetsPriceIncreaseThreshold and symbolMeetsMACDThreshold)
// Place a buy order for the most liquid futures pair
strategy.entry("Buy", strategy.long, symbol=mostLiquidPair)

// Set trailing stop for the most liquid futures pair
strategy.exit("TrailingStop", from_entry="Buy", loss=0.04)

// Call the Bitget Futures buy function
buy(mostLiquidPair)
 
Last edited:
Hello,
The problem is that ChatGPT is bad at code, that's why I'm asking for help from experienced devs...
Nevertheless, thank you for your feedback.
 
Hello,
The problem is that ChatGPT is bad at code, that's why I'm asking for help from experienced devs...
Nevertheless, thank you for your feedback.
I usually find it gets 85% there, you should be able to figure out the rest. Good luck.
 
Where is the code please? Thanks
 
Sorry but this link doesn't work
 
Yes, it didn't appear before, now yes.
But the code throws an error in Pine Script when I want to compile :/
 
Top