[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] code need to be tweek


  • Date: Sun, 17 Jan 2010 17:13:20 -0000
  • From: "goldwing01_1999" <goldwing01_1999@xxxxxxxxx>
  • Subject: [amibroker] code need to be tweek

PureBytes Links

Trading Reference Links

I found this code on the web somewhere, however I never used it but as I set here going through my email box I inserted this code into Amibroker.  Looked it over and it looks promising but it is not complete. If someone can figure out what's wrong with it I would appreciate it.


Period   = Param("Period", 10, 1, 100, 1);
VolRange = Param("Volatility Range", 2, 0, 5, 0.5);
Width    = VolRange *ATR(20)/C*100;

tr       = (Ref(HHV(H,Period),-1) < C*(1 + Width/100)) AND 
(Ref(LLV(L,Period),-1) > C*(1 - Width/100));
trPerc   = IIf((Ref(HHV(H,Period),-1) < C*(1 + Width/100)) AND 
(Ref(LLV(L,Period),-1) > C*(1 - Width/100)), (C - 
Ref(LLV(L,Period),-1))/(Ref(HHV(H,Period),-1) - Ref(LLV(L,Period),-1))*100, 0);

bkup     = IIf((Ref(tr,-1) == 1) AND (C > Ref(Ref(HHV(H,Period),-1),-1)), 100, 0);
bkdown   = IIf((Ref(tr,-1) == 1) AND (C < Ref(Ref(LLV(L,Period),-1),-1)), 100, 0);

GraphXSpace = 2;

Plot(trPerc, "TRADING RANGE ( " + WriteVal(Width, 1.0) + " % )", 10, 
styleHistogram | styleThick);
Plot(bkup, "  BKUP", colorGreen, styleHistogram | styleThick);
Plot(bkdown, "  BKDOWN", colorRed, styleHistogram | styleThick);
Plot(10, "", IIf(tr, colorLightOrange, colorWhite),styleOwnScale|styleArea|styleNoLabel, -1, 100 );



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/