Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Darvas Box with Exploration for Amibroker (AFL)
ariko
almost 14 years ago
Amibroker (AFL)

Rating:
5 / 5 (Votes 1)
Tags:
amibroker, exploration, darvas

MS Darvas Box with Exploration which allows Darvas Box color/style changing and set the price range in exploration.

Created By TohMZ

Screenshots

Similar Indicators / Formulas

Three Day Balance Points
Submitted by nvkha over 9 years ago
Deel - Average Dollar Price Volatility
Submitted by kaiji about 14 years ago
miftha indicator
Submitted by coolpace over 13 years ago
DIX50,20,10
Submitted by morgen over 13 years ago

Indicator / Formula

Copy & Paste Friendly
/*
  MS Darvas Box with Exploration
  ==============================

  
  Translate from http://trader.online.pl/MSZ/e-w-Darvis_Box.html
  
  - Improve scripting
      * Allow Darvas Box Color/Style Changing
  - Exploration
      * Scan Price From .. To
*/
SetChartOptions( 0, chartShowArrows|chartShowDates ); 

_SECTION_BEGIN("Price Chart");

_N(Title = StrFormat("{{NAME}}- {{INTERVAL}} {{DATE}} O= %g, H= %g, L= %g, C= %g (%.1f%%) V= " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
PriceStyle = GetPriceStyle();
PriceStyleOpt = ParamStyle("Price Style")|PriceStyle;

if (PriceStyle==styleCandle)
   Plot( C, "", colorBlack,  PriceStyleOpt); 
else
   Plot( C, "", IIf( Close >= Ref(C, -1), colorBlue, colorRed ), PriceStyleOpt);

_SECTION_END();

_SECTION_BEGIN("Darvas Box");

Periods= Param("Darvas Periods",5,5,260); 

boxHigh = Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND 
                  Ref(H,-3)>Ref(H,-2) AND Ref(H,-3)>Ref(H,-1) AND Ref(H,-3)>H;

Topbox=ValueWhen(boxHigh, Ref(H,-3)); 
Botbox=ValueWhen(boxHigh,LLV(L,4)); 
 

/*=========================
  - Allow color change
  - Style change 
 ==========================*/
Plot(TopBox, "Top", ParamColor("Box Top Color",  colorRed),    ParamStyle("Box Top Style"));
Plot(Botbox, "Bot", ParamColor("Box Bottom Color",colorBlue),  ParamStyle("Box Bottom Style"));

_SECTION_END();

_SECTION_BEGIN("Exploration");

//== Price Increment Value - depend on different country
Inc = 0.1;  


//== Set the Price Range for stock to scan
PriceFrom = Param("Price From:", 5,   0.1, 200, Inc); 
PriceTo   = Param("Price To:",   100, 0.1, 200, Inc); 

/*
   MAV - Moving Average of Volume
    Buy  - Default 20 days  
    Sell - default 10 days

  Filter:
   Buy:  Today Buy Volume must be > N time of Buy MAV. 
         (Buy Up required Huge push force)
         The previous Day High must be below the Darvas Top and Today must close above Darvas Top 

   Sell: Today Sell Volume must be > N time of Sell MAV
         (Sell Down required small pull force)
         The previous Day Low must be above the Darvas bottom and Today must close below Darvas Low 

*/
Buy_MAPds  = Param("Buy: MAV. Periods",  20, 1, 260); 
Buy_VxMAV  = Param("Buy: V > NxMAV",  2, 0, 20, 0.1); 
Sell_MAPds = Param("Sell: MAV. Periods",  10, 1, 260); 
Sell_VxMAV = Param("Sell: V > NxMAV",  1, 0, 20, 0.1); 

BuyMAV = MA(V, Buy_MAPds);
SellMAV = MA(V, Sell_MAPds);

/* Rule to Filter
   - 
   - The previous Day High must be inside the Darvas Top and Today must close above Darvas Top 

*/
Buy = Ref(H, -1) <=TopBox AND C>TopBox  AND (V>Buy_VxMAV*BuyMAV); 
Sell = Ref(L, -1) >=Botbox AND C<Botbox AND (V>Sell_VxMAV*SellMAV); 


Filter  = (Buy OR Sell) AND (C>=PriceFrom AND C<=PriceTo);

AddTextColumn(FullName(), "Security", 1.0, colorDefault, colorDefault, 200); 
AddTextColumn(WriteIf(Buy, "Buy", WriteIf(Sell, "Sell", "-")), "Trade", 1.0, 
                      colorYellow,
                      IIf(Buy, colorGreen, IIf(Sell, colorRed, colorDefault)),  50);
AddColumn(C, "Price", 0.3, colorDefault, colorDefault, 60); 
AddColumn(V, "Volume", 1.0, colorDefault, colorDefault,80); 

_SECTION_END();

1 comments

1. FTAKSA

tks alot

Leave Comment

Please login here to leave a comment.

Back