Code of following strategy

PLease ans this question

#1

Buy : buy at todays high   <----should buy tomorrow at todays high if below condition is fullfilled

if ( ( yesterdays high > todays high) and (yesterday low < todays low) )

sell : EOD (using MIS type)

eg.  yesterdays high- 100

yesterdays low- 80

todays high-95

todays high- 85

here it is fulfilling the condition --->if ( ( yesterdays high > todays high) and (yesterday low < todays low) )

then buy tomorrow at 100

#2

BUY:

Buy at todays open if (yesterday close > todays open) OR

Sell at todays open if (yesterday close < todays open)

BUY EXIT:

 at yesterday close price

SL :

Todays open – ( yesterdays close – todays open )

#3

Swing high : ( HIGH < REF(HIGH,1) ) AND ( REF(HIGH,1) > REF(HIGH,2) ) AND ( REF(HIGH,1) > REF(HIGH,3) ) AND ( REF(HIGH,1) > REF(HIGH,4) )

Swing Low : ( LOW > REF(LOW,1) ) AND ( REF(LOW,1) < REF(LOW,2) ) AND ( REF(LOW,1) < REF(LOW,3) ) AND ( REF(LOW,1) < REF(LOW,4) )

 Condition :Before Swing high is made there should not be swing low for past 6 days from swing high

If above condition is satisfied then buy at 8 days channel breakout high

As per the above condition use day time frame.

#1

BuyScript:

LAST>=HIGH AND REF(HIGH,2)>REF(HIGH,1) AND REF(LOW,2)<REF(LOW,1)

#2

BuyScript:

REF(CLOSE,1)> OPEN

SellScript:

REF(CLOSE,1)< OPEN

BuyExit:

REF(CLOSE,1)

StopLoss:

OPEN-(REF(CLOSE,1)-OPEN)

#3

As per the condition of swing it is not possible in tradescript