Skip to main content

Presto's Magic Box for Amibroker (AFL)

kelvinhand almost 13 years ago Amibroker (AFL)

  • Rating:
    2 / 5 (Votes 5)
  • Tags:
    amibroker, darvas

By Jason Prestwidge.

  • Presto’s Magic Box – a tweaked version of Darvas box

Metastock script and picture can be seen from:
http://srsc.com.vn/metastock-codes/e-w-Prestos_Magic_Box.html

  • Drag and Drop into Price Chart

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Presto's Magic Box");
Periods=Param("periods",100,4,260);

//--Kelvinhand
HHVtemp = HHV( High, Periods );
LLVtemp = LLV( Low, Periods );

TopBox = HHVTemp;
BotBox = LLVTemp;

for( i = Periods + 4; i < BarCount; i++ )
 {

   if( H[ i - 3 ] >= HHVTemp[ i - 4 ] AND
                     H[ i - 3 ] > H[ i - 2 ] AND
                     H[ i - 3 ] > H[ i - 1 ] AND
                     H[ i - 3 ] > H[ i ])

   {                     

      Topbox[ i ] =  H[i-3];
      Botbox[ i ] = LLVTemp[i];

   }
   else
   {   //*** PREV ****
      Topbox[ i ] = Topbox[ i-1];
      Botbox[ i ] = Botbox[i-1];

   }

}

//Plot( C, "Price", colorBlack, styleCandle );

Plot( Topbox, "PM_Top", ParamColor("PM_Top.Color",colorRed),  Param("PM_Top.Style",styleNoLabel,maskAll) );
Plot( Botbox, "PM_Bot", ParamColor("PM_Bot.Color",colorGreen), Param("PM_Bot.Style",styleNoLabel,maskAll) );

_SECTION_END();

1 comments

almost 13 years ago

Hi Kelvinhand
Thanks for the nice conversion.
Can you convert this TS code Power RSI Pivot also
http://srsc.com.vn/metastock-codes/t-i-Power_RSI_Pivot.html

Leave Comment

Please login here to leave a comment.