Python Developer Needed – OpenAlgo Multi-Stock Trading Strategy (PMPS V2.0)

Job ID: 40514252

Budget: ₹600 – ₹1,500 INR

Project Overview

I already have a working OpenAlgo setup with broker integration, WebSocket, scheduler, and order execution. I need an experienced Python/OpenAlgo developer to implement a new strategy logic called **PMPS V2.0 (Progressive Momentum Pyramid Strategy)**.

This is not a complete application development project. Existing OpenAlgo infrastructure is already available. Only strategy logic and position management need to be developed.

Scope of Work

Develop a production-grade multi-stock strategy that:

* Runs continuously during market hours.
* Supports multiple stocks simultaneously.
* Maintains independent state for each stock.
* Can be deployed on Oracle Cloud, AWS EC2, Docker, or PM2.
* Persists state so that server restarts do not lose positions.

---

## Existing Components (Already Available)

Please reuse the existing OpenAlgo framework:

* API connection
* Broker integration
* WebSocket
* Scheduler
* Order execution
* Existing strategy framework

No modifications are required for:

* Authentication
* Broker layer
* WebSocket
* Scheduler

Only strategy logic must be implemented.

---

## Supported Brokers

Through OpenAlgo:

* ICICI Direct Breeze
* Zerodha
* Angel One
* Upstox
* Dhan

No broker-specific code should be written.

---

## Multi-Stock Support

Example:

```python
STOCKS_LIST = [
"RELIANCE",
"TCS",
"INFY",
"HDFCBANK",
"ICICIBANK"
]
```

Each stock should maintain its own position and state.

---

## Buy Logic

### Buy1

Investment:

₹40,000

### Buy2

Condition:

Price >= Base Price × 1.02

Investment:

₹20,000

### Buy3

Condition:

Price >= Base Price × 1.04

Investment:

₹25,000

### Buy4

Condition:

Price >= Base Price × 1.06

Investment:

₹30,000

Maximum exposure:

₹1,15,000 per stock.

---

## Profit Booking

### Target1

Sell 20%

Condition:

Average Price × 1.05

---

### Target2

Sell 30%

Condition:

Average Price × 1.064

---

### Target3

Sell remaining quantity

Condition:

Average Price × 1.07

Close position.

---

## Stop Loss

Condition:

CMP <= Average Price × 0.90

Action:

* Sell all quantity
* Reset strategy

Maximum loss:

10%

---

## Trailing Stop

Activated after Target1.

Track highest price reached.

Condition:

CMP <= Highest Price × 0.95

Sell remaining quantity.

---

## Time Exit

Maximum holding period:

30 trading days

Condition:

holding_days > 30

Action:

Sell all quantity.

---

## Quantity Normalization

Use integer quantities only.

Examples:

| Raw Qty | Final Qty |
| ------- | --------- |
| 1.3 | 1 |
| 1.5 | 2 |
| 1.7 | 2 |
| 2.5 | 3 |

Implementation:

```python
qty = max(1, round(raw_qty))
```

---

## Position State

Maintain independent state per stock:

```python
{
"base_price":100,
"average_price":102.77,
"highest_price":110,
"total_cost":115000,
"total_qty":1119,

"buy1_done":True,
"buy2_done":True,
"buy3_done":True,
"buy4_done":True,

"target1_done":False,
"target2_done":False,
"target3_done":False,

"trailing_active":False,
"position_open":True
}
```

---

## State Machine

NEW



BUY1_FILLED



BUY2_FILLED



BUY3_FILLED



BUY4_FILLED



POSITION_OPEN



TARGET1_DONE



TRAILING_MODE



TARGET2_DONE



TARGET3_DONE



POSITION_CLOSED

Emergency States:

* STOPLOSS_HIT
* TRAILING_STOP_HIT
* TIME_EXIT

---

## Persistence

Need persistence using one of the following:

Preferred:

* PostgreSQL

Alternative:

* SQLite
* JSON

Strategy should recover automatically after cloud/server restart.

---

## Notifications

Telegram alerts for:

* Buy execution
* Partial profit booking
* Stop loss hit
* Position closed

---

## Deliverables

### Main File

```
pmps_strategy.py
```

### Optional Structure

```
core/
strategy_engine.py
position_manager.py
risk_manager.py
quantity_manager.py

database/
repository.py


## Deployment

Must support:

* Oracle Cloud
* AWS EC2
* Docker
* PM2

Example:

```bash
python pmps_strategy.py
```

---

## Preferred Skills

* Python
* OpenAlgo
* Trading APIs
* PostgreSQL
* Docker

---

Please Apply Only If You Have Experience With

* OpenAlgo
* Algorithmic trading
* Position management
* Multi-stock strategies
* Cloud deployment