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

Message Box v1.0 for Amibroker (AFL)

Rating:
3 / 5 (Votes 2)
Tags:
trading system, amibroker

This is simple message box code but some advance tgt1,2,3 and color change with buy sell only copy and pste in your amibroker afl formula below buy/sell code and enjoy your trading….

Similar Indicators / Formulas

EMA crossover
Submitted by Ketan-0 almost 14 years ago
Kase Peak Osc. V2 batu
Submitted by batu1453 over 10 years ago
Kase CD V2batu
Submitted by batu1453 over 10 years ago
Ichimoku
Submitted by prashantrdx over 10 years ago
buy and sell two EMAS
Submitted by mundo0007 over 12 years ago
Adaptive Price Zone (APZ)
Submitted by AndrewThomas almost 14 years ago

Indicator / Formula

Copy & Paste Friendly
Cover=Buy;
Short=Sell;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

GraphXSpace = 5;
pxHeight = Status( "pxchartheight" ) ;
xx = Status( "pxchartwidth");
Left = 1100;
width = 310;
x = 5;
x2 = 260;
 
y = pxHeight; 
dist = 2*ATR(10);
dist1 = 3*ATR(10);
 
for( i = 0; i < BarCount; i++ )
{
    if( Buy[i] )
    {
        // PlotText( "\nBuy:" + L[ i ] + "\nT= " + (L[i]*1.005) + "\nSL= " + (L[i]*0.9975), i, L[ i ]-dist[i], colorGreen, colorWhite );
        
        // Signal Display Panel //
         SellPrice=ValueWhen(Sell,C,1);
BuyPrice=ValueWhen(Buy,L[ i ]);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );
        BuyStop2 = L[i]*0.9975;
        BuyTP1 = L[i]*1.070;
        BuyTP2 = L[i]*1.050;
        BuyTP3 = L[i]*1.035;
        GfxSelectFont( "Tahoma", 13, 100 );
        GfxSetOverlayMode( mode = 0 );
        GfxSelectPen( colorBrightGreen, 3 );
        GfxSelectSolidBrush( colorBrightGreen);
        GfxRoundRect( x, y - 163, x2, y , 7, 7 ) ;
       GfxSetTextColor( colorGold );        
       GfxTextOut( ( " Trading System "),73,y-165);
        GfxTextOut( (" "),27,y-160);
        GfxSetBkMode(1);
        GfxSelectFont( "Arial", 10, 700, False );
        GfxSetTextColor( colorBlue );
        GfxSetTextAlign(0);
        GfxSelectFont( "Tahoma", 13, 100 );

   GfxTextOut( WriteIf(L[ i ], "Buy Above: "+L[ i ],""), 13, y-140);
   GfxSetTextColor( colorGold );    
   GfxTextOut( WriteIf(BuyStop2, "Long SL: "+(BuyStop2),""), 13, y-120);
   GfxSetTextColor( colorWhite );    
   GfxTextOut( WriteIf(BuyTP1, "Buy TGT1: "+(BuyTP3),""), 13,y- 100);
   GfxTextOut( WriteIf(BuyTP2, "Buy TGT2: "+(BuyTP2),""), 13,y- 80); 
   GfxTextOut( WriteIf(BuyTP3, "BuyTGT3: "+(BuyTP1),""), 13,y- 60);   
   GfxSetTextColor( colorViolet );    
   GfxTextOut( ("Current P/L : " + WriteVal(IIf(Buy ,(C-BuyPrice),(C-BuyPrice)),2.2)), 88, y-22);
        
        
        // END of Signal Display Panel //
    }
    if( Sell[i] )
    {
        // PlotText( "Sell:" + H[ i ] + "\nT= " + (H[i]*0.995) + "\nSL= " + (H[i]*1.0025), i, H[ i ]+dist1[i], colorRed, colorWhite );
        
        // Signal Display Panel //
        SellPrice=ValueWhen(Sell,C,1);
BuyPrice=ValueWhen(Buy,H[ i ]);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );
       SellStop2 = H[i]*1.0025;
        SellTP1 = H[i]*0.978;
        SellTP2 = H[i]*0.982;
        SellTP3 = H[i]*0.988;
        GfxSelectFont( "Tahoma", 13, 100 );
        GfxSetOverlayMode( mode = 0 );
        GfxSelectPen( colorRed, 3 );
        GfxSelectSolidBrush( colorRed );
         GfxRoundRect( x, y - 163, x2, y , 7, 7 ) ;
        
        GfxTextOut( (" "),27,y-160);
        GfxSetBkMode(1);
        GfxSelectFont( "Arial", 10, 700, False );
        GfxSetTextColor( colorWhite );
        GfxSetTextAlign(0);
        GfxSelectFont( "Tahoma", 13, 100 );
        GfxSetTextColor( colorGold );      
        GfxTextOut( ( " Trading System "),73,y-165);
        GfxSetTextColor( colorWhite ); 
       GfxTextOut( WriteIf(H[ i ], "Sell Below: "+H[ i ],""), 13, y-140);
       GfxSetTextColor( colorGold );     
       GfxTextOut( WriteIf(SellStop2, "Short SL: "+(SellStop2),""), 13, y-120);     
       GfxSetTextColor( colorBlue );   
       GfxTextOut( WriteIf(SellTP1, "Short TGT1: "+(SellTP3),""), 13, y-100);
       GfxTextOut( WriteIf(SellTP2, "Short TGT2: "+(SellTP2),""), 13, y-80);
       GfxTextOut( WriteIf(SellTP3, "Short TGT3: "+(SellTP1),""), 13, y-60);
       GfxSetTextColor( colorGold );
       GfxTextOut( ("Current P/L : " + WriteVal(IIf(Sell ,(SellPrice-C),(SellPrice-C)),2.2)), 88, y-22);
    // END of Signal Display Panel //
    }
 
}

7 comments

1. vtrader

jaipal7786 sir, some error..

2. jaipal7786

vtrader ji write your error here…..

3. vtrader

Error 29
Variable sell used without being initialized

4. jaipal7786

vtrader ji read carefully in the afl comentry box above tag..
copy and pste in your amibroker afl formula below buy/sell code

thanx….

5. jaipal7786

also add these code with this afl old color disable in your afl must with // in starting..

for( i = 0; i < BarCount; i++ )
{
 if( Buy[i] )
 {

OUTcolor = ParamColor("Outer Panel Color",colorTeal);
INUPcolor = ParamColor("Inner Panel Upper",colorDarkGrey);
INDNcolor = ParamColor("Inner Panel Lower",colorDarkOliveGreen);
TitleColor = ParamColor("Title Color ",colorBlack);
SetChartBkColor(OUTcolor); // color of outer border
SetChartBkGradientFill(INUPcolor,INDNcolor,TitleColor); // color of inner panel
}
if( Sell[i] )
{
OUTcolor = ParamColor("Outer Panel Color",colorTeal);
INUPcolor = ParamColor("Inner Panel Upper2",colorDarkTeal);
INDNcolor = ParamColor("Inner Panel Lower2",colorPlum);
TitleColor = ParamColor("Title Color ",colorBlack);
SetChartBkColor(OUTcolor); // color of outer border
SetChartBkGradientFill(INUPcolor,INDNcolor,TitleColor); // color of inner panel
}
}
6. john_d

can you plz ad the modified and check version…

7. kananwisha

I got it. Thanks

This excellent code doesn’t run by itself.

You can add these codes to any of your AFL codes, just below buy/sell conditions
in yours codes.

Thanks the authors

Leave Comment

Please login here to leave a comment.

Back