Here is Darvis Box from the Interent:
LowL:=If(LOW=LLV(LOW,5),LOW,If(Ref(LOW,-1)=LLV(LOW,5),Ref(LOW,-1), If(Ref(LOW,-2)=LLV(LOW,5),Ref(LOW,-2),If(Ref(LOW,-3)=LLV(LOW,5),Ref(LOW,-3), If(Ref(LOW,-4)=LLV(LOW,5),Ref(LOW,-4),0)))));
NewH:=ValueWhen(1,HIGH>Ref(HHV(HIGH,5),-1),HIGH);
box1:=HHV(HIGH,3)<HHV(HIGH,4);
box2:=ValueWhen(1,BarsSince(HIGH>Ref(HHV(HIGH,5),-1))=3 AND box1=true,NewH);
box3:=ValueWhen(1,BarsSince(HIGH>Ref(HHV(HIGH,5),-1))=3 AND box1=true,LowL);
TopBox:=box2;
BottomBox:=box3;
TopBox;
BottomBox;
You can modify the code to your liking.