Skip to content

VinayChaudhari1996/swing_profit_trading_strategy_logic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

SwingProfit

Timeseries buy and sell strategy for maximum profits

Indian stocks example: Note Only for educational purposes and self-use

image

image


For Nerds

image

Example:

Let's consider a simplified example:

  • Initial Capital: $50,000
  • Buy Signal Condition: RSI < 50 and Close < Lower Bollinger Band
  • Sell Signal Condition: RSI > 50 and Close > Upper Bollinger Band
# Sample Data (Closing Prices)
data = [100, 110, 95, 120, 130, 90, 80, 110, 115, 125]

# Example Buy and Sell Signals
Buy_Signal = [0, 0, 1, 0, 0, 1, 0, 0, 0, 0]
Sell_Signal = [0, 0, 0, 0, 0, 0, 0, 0, 1, 0]

# Example Trades
Trades = [('Buy', '2023-01-01', 95, 10), ('Sell', '2023-01-05', 130, 10)]

This example assumes a simple list of closing prices and manually generated buy and sell signals for illustration purposes. In a real-world scenario, these signals would be generated by the strategy based on the calculated RSI and Bollinger Bands.

The Gradio interface allows you to input a stock symbol, period, and interval to analyze the strategy's performance for a specific stock. The output includes metrics such as profitability, buy and sell counts, net profit, ROI, and a visual representation of the strategy's execution.

About

Timeseries buy and sell strategy for maximum profits

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published