Trading strategy on the sma 25/50 with the algorithm

You can add Inner I SMA 25/50 algorithm with “Buy” and “Sell” signals into Pine Editor on Trading View!

Inner I SMA 25/50 Strategy for BTC/U.S. Dollar

https://www.tradingview.com/x/0t5UUkrO/

Strategy Tester is set for $1000 investment with the Trading Range set to 01/01/2023-06/21/2023

Net Profit – $358.58, Percent Profitable -35.35%

The Algorithm

add this code or the code further down to Pine Editor section on Trading View site

//@version=5
strategy("Inner I SMA 25/50 Strategy", overlay=true)

sma25 = ta.sma(close, 25)
sma50 = ta.sma(close, 50)

longCondition = ta.crossover(sma25, sma50) and time >= timestamp("UTC-4", 2023, 01, 01)
shortCondition = ta.crossunder(sma25, sma50) and time >= timestamp("UTC-4", 2023, 01, 01)

if (longCondition)
    strategy.entry("Buy", strategy.long)
if (shortCondition)
    strategy.entry("Sell", strategy.short)


plot(close)

Find your Time Zone and change year, month, date accordingly.

example: (“UTC+4”, 2023, 01, 01)

Create a Signaling Bot on Pionex.us

I hit a dead-end at Pionex; however, paid accounts at Trading View and/or Pionex may allow you to create a signaling bot.

https://pionexus.zendesk.com/hc/en-us/articles/18210609319705-Unavailability-of-Signal-Bot-and-GPT-Marketplace

Create a strategy at PionexGPT

Code with stop-loss or take-profit orders

https://www.tradingview.com/x/5Zklnx3k/

“In this script, I’ve defined a stop-loss and a take-profit level for each position you’re entering. For the long position, a stop-loss order is placed 1% below the entry price and a take-profit order is placed 2% above the entry price. For the short position, a stop-loss order is placed 1% above the entry price and a take-profit order is placed 2% below the entry price. You can adjust these levels according to your risk tolerance.

Please, note that the stop and limit prices are calculated based on the close price when the order is submitted. If the price has changed before the order is filled, these levels may not match your intended risk and reward ratio.” ~ OpenAI

//@version=5
strategy("Inner I SMA 25/50 Strategy", overlay=true)

sma25 = ta.sma(close, 25)
sma50 = ta.sma(close, 50)

longCondition = ta.crossover(sma25, sma50) and time >= timestamp("UTC-4", 2023, 01, 01)
shortCondition = ta.crossunder(sma25, sma50) and time >= timestamp("UTC-4", 2023, 01, 01)

// Define your stop-loss and take-profit levels (in percentage)
stopLossLevel = 1 // 1% stop loss
takeProfitLevel = 2 // 2% take profit

if (longCondition)
    strategy.entry("Buy", strategy.long)
    strategy.exit("Exit Long", "Buy", stop=close*(1-stopLossLevel/100), limit=close*(1+takeProfitLevel/100))

if (shortCondition)
    strategy.entry("Sell", strategy.short)
    strategy.exit("Exit Short", "Sell", stop=close*(1+stopLossLevel/100), limit=close*(1-takeProfitLevel/100))


plot(close)

Please share ideas and progress!

Leave a comment

Leave a comment