Hello,
This is my code for AmiBroker displaying MO Weekly CrashZone.
[font=Courier New]dow = DayOfWeek();
newWeek = dow < Ref( dow, -1);
W0High = HighestSince( newWeek, High);
W0Low = LowestSince( newWeek, Low);
W0Range = W0High-W0Low;
BarsInWeek0=BarsSince(newWeek);
W1Range=Ref(W0Range,-BarsInWeek0-1);
W2Range=Ref(W1Range,-BarsInWeek0-1);
W3Range=Ref(W2Range,-BarsInWeek0-1);
MedianRange=Min(Min((Max(W1Range,W2Range)),(Max(W1Range,W3Range))),Max(W2Range,W3Range));
LTarget1=W0Low+MedianRange*4/6;
LTarget2=W0Low+MedianRange*5/6;
LTarget3=W0Low+MedianRange*7/6;
LTarget4=W0Low+MedianRange*8/6;
STarget1=W0High-MedianRange*4/6;
STarget2=W0High-MedianRange*5/6;
STarget3=W0High-MedianRange*7/6;
STarget4=W0High-MedianRange*8/6;
PlotOHLC(LTarget2,LTarget2,LTarget1,LTarget1,"LT1Area",colorGreen,styleCloud);
PlotOHLC(LTarget4,LTarget4,LTarget3,LTarget3,"LT2Area",colorGreen,styleCloud);
PlotOHLC(STarget1,STarget1,STarget2,STarget2,"ST1Area",colorRed,styleCloud);
PlotOHLC(STarget3,STarget3,STarget4,STarget4,"ST2Area",colorRed,styleCloud);[/font]
Thanks to MO and Marcin Gorzynski (Amibroker.com Technical Support)
Cheers
Francisco
MO_CrashZone for AmiBroker
Moderator: moderators
MO_CrashZone for AmiBroker
Last edited by frang0nve on Mon Jul 09, 2012 3:23 am, edited 2 times in total.
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
-
- rank: 50+ posts
- Posts: 111
- Joined: Sat Dec 31, 2011 7:28 pm
- Reputation: 0
- Gender:
- Contact:
-
- rank: 50+ posts
- Posts: 111
- Joined: Sat Dec 31, 2011 7:28 pm
- Reputation: 0
- Gender:
- Contact:
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.