Require Code for Below Strategy

Please help me with coding below strategy.

Buy Condition :-

1) Price should open above SMA 200

2) Buy MACD Crossover (12,26,9) 

Note:- Both the conditions should meet then only Buy should be executed.

SL :- 

Any of the condition below.

1) Prices open below SMA 200

2) On Sell MACD Cross over (12,26,9)

Target :-

Rs 15 from the entry point.

Sell Condition:-

1) Price should open below SMA 200

2) Sell MACD Crossover (12,26,9) 

Note:- Both the conditions should meet then only Buy should be executed.

SL :- 

Any of the condition below.

1) Prices open above SMA 200

2) On Buy MACD Cross over (12,26,9)

Target :-

Rs 15 from the entry point.

As per the above condition 

BuyScript:

SET A = MACDSignal(12, 26, 9, SIMPLE)
SET B = MACD(12, 26, 9, SIMPLE)
OPEN>SMA(CLOSE,200) AND 
CROSSOVER(A, B) = TRUE

SellScript:

SET A = MACDSignal(12, 26, 9, SIMPLE)
SET B = MACD(12, 26, 9, SIMPLE)
OPEN<SMA(CLOSE,200) AND 
CROSSOVER(B, A) = TRUE

For the targets 15 points can not be defined by the script, can be used price alert indicator for this manually specifying price

https://zerodha.com/expert-advisors/code/price-alert-indicator