---
# System prepended metadata

title: 20230228 民生社區咖啡廳第一次協作

---

# 20230228 民生社區咖啡廳第一次協作

## 工作目標

#### 優先完成
1. 實現Phoenix的策略
2. 解quantExample的bug
3. 討論量化交易的input (除了開高收低以外)


#### 工具使用
1. hackMD 操作教學
2. git 操作教學

#### 三泰學習目標
1. 交割戶拿到之後該怎麼辦XD (開元大api) 
2. 量化基礎名詞解釋
3. 看盤軟體教學

#### 團隊分潤

雖然感覺有點尷尬，但我覺得還是討論一下比較好
(Nils回)投資是看出本金多寡，初期我建議是大家共同努力把script做好後，使用這套策略的投資後果自負，待營運穩定且有本金可成立公司後，再用共同基金的形式來討論分潤

---

### Phoenix 策略
```
5日均價>10日均價>30日均價 and Price>5日均價 and 10日均價 and 20日均價 60日均價 and 120均價 and 240均價-->Buy

then

if (price <= 60日均價 at T-Day) && (Price at (T+1) Day lower than T Day) && Price at (T+2) Day lower than (T+1) Day {

    Do Sell;
}

if (price <= 60日均價 at T-Day) && (Price at (T+1) Day higher than T Day) && (Price at (T+2) Day Higher than (T+1) Day) && (price>=60日均價) {

    Do Keep;
}
 
if (price <= 60日均價 at T-Day) && (Price at (T+1) Day higher than T Day) && (Price at (T+2) Day Higher than (T+1) Day) && (price>=60日均價 && amount is more than 7 days) {

    Buy
}

```

### Phoenix的策略，翻譯後如下
```
QTY = 0

if ma5[-1] > ma10[-1] > ma30[-1] and price[-1] > ma5[-1] and price[-1] > ma10[-1] and price[-1] > ma20[-1] and price[-1] > ma60[-1] and price[-1] > ma120[-1] and price[-1] > ma240[-1]:
QTY += 1
# buy code here

if QTY >= 1 and price[-1] <= ma60[-1] and price[-2] < price[-1] and price[-3] < price[-2]:
QTY -= 1
# sell code here

if QTY >= 1 and price[-1] <= ma60[-1] and price[-2] > price[-1] and price[-3] > price[-2] and price[-1] >= ma60[-1]:
# keep code here
pass

if QTY >= 0 and price[-1] <= ma60[-1] and price[-2] > price[-1] and price[-3] > price[-2] and price[-1] >= ma60[-1] and QTY > 7:
QTY += 1
# buy code here
```