# Strategies from PHI 1’s Webinar – Creating a MACD Strategy on PHI 1 (6th November 2020) (Disclaimer: These strategies were showcased as part of our educational webinar – Creating a MACD Strategy on PHI 1 (6th November 2020). The purpose of sharing these strategies is purely educational. Please do not consider these for investment purpose)

1. MACD Strategy

Original Source: View Video

You will find the entry and exit condition in this video which you can create using PHI 1’s Strategy Creator in the Form Code (No coding required)

2. Guppy Multiple Moving Averages Strategy

Original Source: View Video

Since this one is a complex strategy, we have created this one using PHI 1’s Strategy Creator in the Code Mode.

Here’s the code for the same. You can try it out for free

INIT

# short term moving averages

self.sema1 = EMA(close,period=3)

self.sema2 = EMA(close,period=5)

self.sema3 = EMA(close,period=8)

self.sema4 = EMA(close,period=10)

self.sema5 = EMA(close,period=12)

self.sema6 = EMA(close,period=15)

# long term moving averages

self.lema1 = EMA(close,period=30)

self.lema2 = EMA(close,period=35)

self.lema3 = EMA(close,period=40)

self.lema4 = EMA(close,period=45)

self.lema5 = EMA(close,period=50)

self.lema6 = EMA(close,period=60)

# confirmation long term moving average

self.conf_lema = SMA(close,period=200)

# ATR

self.atr = ATR()

————————————
STEP

# entry

if self.position.size == 0:

list_sema = [self.sema1, self.sema2, self.sema3, self.sema4, self.sema5, self.sema6]

list_lema = [self.lema1, self.lema2, self.lema3, self.lema4, self.lema5, self.lema6]

if min(list_sema) > max(list_lema) and low > self.conf_lema and min(list_sema) > self.conf_lema and min(list_lema) > self.conf_lema:

# buy_bracket(limitprice=close + self.atr*8, price=close, stopprice=close – self.atr*4)

#exit

if self.position.size > 0:

list_sema = [self.sema1, self.sema2, self.sema3, self.sema4, self.sema5, self.sema6]

list_lema = [self.lema1, self.lema2, self.lema3, self.lema4, self.lema5, self.lema6]

if min(list_sema) <= max(list_lema) or low <= self.conf_lema:

square_off()

READ :   7 reasons PHI 1 is a unique algo trading platform

### How to use this code on PHI 1

1. Copy & Paste the Init code in the – Enter initialize code here section
2. Copy & Paste the Step code in the – Enter step code here section
3. Click Run And Save If you need any help or have any questions, then please schedule a demo session with us and we will help you out.