Monday, 4 May 2020

Pin Bar Candlestick Pattern Detector for Amibroker (AFL)



A pin bar pattern consists of one price bar, typically a candlestick price bar, which represents a sharp reversal and rejection of price. The pin bar reversal as it is sometimes called, is defined by a long tail, the tail is also referred to as a “shadow” or “wick”. The area between the open and close of the pin bar is called its “real body”, and pin bars generally have small real bodies in comparison to their long tails.

The tail of the pin bar shows the area of price that was rejected, and the implication is that price will continue to move opposite to the direction the tail points. Thus, a bearish pin bar signal is one that has a long upper tail, showing rejection of higher prices with the implication that price will fall in the near-term. A bullish pin bar signal has a long lower tail, showing rejection of lower prices with the implication that price will rise in the near-term.





_SECTION_BEGIN( "Pin Bar AFL" );

SetBarsRequired( 100000, 0 );

GraphXSpace = 15;

SetChartOptions( 0, chartShowArrows | chartShowDates );

SetChartBkColor( ParamColor( "bkcolor", ColorRGB( 0, 0, 0 ) ) );

GfxSetBkMode( 0 );

GfxSetOverlayMode( 1 );

SetBarFillColor( IIf( C > O, ParamColor( "Candle UP Color", colorGreen ), IIf( C <= O, ParamColor( "Candle Down Color", colorRed ), colorLightGrey ) ) );

Plot( C, "\nPrice", IIf( C > O, ParamColor( "Wick UP Color", colorDarkGreen ), IIf( C <= O, ParamColor( "Wick Down Color", colorDarkRed ), colorLightGrey ) ), 64, 0, 0, 0, 0 );

dec = ( Param( "Decimals", 2, 0, 7, 1 ) / 10 ) + 1;
Title = EncodeColor( 55 ) +  Title = Name() + "     " + EncodeColor( 32 ) + Date() +
                                     "      " + EncodeColor( 5 ) + "{{INTERVAL}}  " +
                                     EncodeColor( 55 ) + "     Open = " + EncodeColor( 52 ) + WriteVal( O, dec ) +
                                     EncodeColor( 55 ) + "     High = " + EncodeColor( 5 ) + WriteVal( H, dec ) +
                                     EncodeColor( 55 ) + "      Low = " + EncodeColor( 32 ) + WriteVal( L, dec ) +
                                     EncodeColor( 55 ) + "    Close = " + EncodeColor( 52 ) + WriteVal( C, dec ) +
                                     EncodeColor( 55 ) + "    Volume = " + EncodeColor( 52 ) + WriteVal( V, 1 );


MaxNoseBodySize = 0.33; // Max. Body / Candle length ratio of the Nose Bar
NoseBodyPosition = 0.4; // Body position in Nose Bar (e.g. top/bottom 40%)
LeftEyeOppositeDirection = True; // true = Direction of Left Eye Bar should be opposite to pattern (bearish bar for bullish Pinbar pattern and vice versa)
NoseSameDirection = False; // true = Direction of Nose Bar should be the same as of pattern (bullish bar for bullish Pinbar pattern and vice versa)
NoseBodyInsideLeftEyeBody = False; // true = Nose Body should be contained inside Left Eye Body
LeftEyeMinBodySize = 0.1; // Min. Body / Candle length ratio of the Left Eye Bar
NoseProtruding = 0.5; // Minmum protrusion of Nose Bar compared to Nose Bar length
NoseBodyToLeftEyeBody = 1; // Maximum relative size of the Nose Bar Body to Left Eye Bar Body
NoseLengthToLeftEyeLength = 0; // Minimum relative size of the Nose Bar Length to Left Eye Bar Length
LeftEyeDepth = 0.2; // Minimum relative depth of the Left Eye to its length; depth is difference with Nose's back

up = down = 0;
point = 0.1;
blpin = brpin = False;

for( i = 1; i < BarCount; i++ )
{

    NoseLength = High[i] - Low[i];

    if( NoseLength == 0 ) NoseLength = Point;

    LeftEyeLength = High[i - 1] - Low[i - 1];

    if( LeftEyeLength == 0 ) LeftEyeLength = Point;

    NoseBody = abs( Open[i] - Close[i] );

    if( NoseBody == 0 ) NoseBody = point;

    LeftEyeBody = abs( Open[i - 1] - Close[i - 1] );

    if( LeftEyeBody == 0 ) LeftEyeBody = point;

    // Bearish Pinbar
    if( High[i] - High[i - 1] >= NoseLength * NoseProtruding ) // Nose protrusion
    {
        if( NoseBody / NoseLength <= MaxNoseBodySize ) // Nose body to candle length ratio
        {
            if( 1 - ( High[i] - Max( Open[i], Close[i] ) ) / NoseLength < NoseBodyPosition ) // Nose body position in bottom part of the bar
            {
                if( ( !LeftEyeOppositeDirection ) || ( Close[i - 1] > Open[i - 1] ) ) // Left Eye bullish if required
                {
                    if( ( !NoseSameDirection ) || ( Close[i] < Open[i] ) ) // Nose bearish if required
                    {
                        if( LeftEyeBody / LeftEyeLength  >= LeftEyeMinBodySize ) // Left eye body to candle length ratio
                        {
                            if( ( Max( Open[i], Close[i] ) <= High[i - 1] ) && ( Min( Open[i], Close[i] ) >= Low[i - 1] ) ) // Nose body inside Left Eye bar
                            {
                                if( NoseBody / LeftEyeBody <= NoseBodyToLeftEyeBody ) // Nose body to Left Eye body ratio
                                {
                                    if( NoseLength / LeftEyeLength >= NoseLengthToLeftEyeLength ) // Nose length to Left Eye length ratio
                                    {
                                        if( Low[i] - Low[i - 1] >= LeftEyeLength * LeftEyeDepth ) // Left Eye low is low enough
                                        {
                                            if( ( !NoseBodyInsideLeftEyeBody ) || ( ( Max( Open[i], Close[i] ) <= Max( Open[i - 1], Close[i - 1] ) ) && ( Min( Open[i], Close[i] ) >= Min( Open[i - 1], Close[i - 1] ) ) ) ) // Nose body inside Left Eye body if required
                                            {
                                                Down[i] = High[i] + 5 * Point + NoseLength / 5;
                                                brpin[i] = True;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    // Bullish Pinbar
    if( Low[i - 1] - Low[i] >= NoseLength * NoseProtruding ) // Nose protrusion
    {
        if( NoseBody / NoseLength <= MaxNoseBodySize ) // Nose body to candle length ratio
        {
            if( 1 - ( Min( Open[i], Close[i] ) - Low[i] ) / NoseLength < NoseBodyPosition ) // Nose body position in top part of the bar
            {
                if( ( !LeftEyeOppositeDirection ) || ( Close[i - 1] < Open[i - 1] ) ) // Left Eye bearish if required
                {
                    if( ( !NoseSameDirection ) || ( Close[i] > Open[i] ) ) // Nose bullish if required
                    {
                        if( LeftEyeBody / LeftEyeLength >= LeftEyeMinBodySize ) // Left eye body to candle length ratio
                        {
                            if( ( Max( Open[i], Close[i] ) <= High[i - 1] ) && ( Min( Open[i], Close[i] ) >= Low[i - 1] ) ) // Nose body inside Left Eye bar
                            {
                                if( NoseBody / LeftEyeBody <= NoseBodyToLeftEyeBody ) // Nose body to Left Eye body ratio
                                {
                                    if( NoseLength / LeftEyeLength >= NoseLengthToLeftEyeLength ) // Nose length to Left Eye length ratio
                                    {
                                        if( High[i - 1] - High[i] >= LeftEyeLength * LeftEyeDepth ) // Left Eye high is high enough
                                        {
                                            if( ( !NoseBodyInsideLeftEyeBody ) || ( ( Max( Open[i], Close[i] ) <= Max( Open[i - 1], Close[i - 1] ) ) && ( Min( Open[i], Close[i] ) >= Min( Open[i - 1], Close[i - 1] ) ) ) ) // Nose body inside Left Eye body if required
                                            {
                                                Up[i] = Low[i] - 5 * Point - NoseLength / 5;
                                                blpin[i] = True;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

for( i = 1; i < BarCount; i++ )
{
    if( blpin[i] ) PlotText( "bull.pin " , i, L[ i ] - 2.5, colorLime );

    if( brpin[i] ) PlotText( " bear pin" , i, H[ i ] + 2.5, colorOrange );
}

PlotShapes( shapeHollowSmallSquare*brpin, 4, 0, H , 5 );
PlotShapes( shapeHollowSmallSquare*blpin, 5, 0, L , -5 );

Filter = brpin OR blpin;
AddColumn( brpin, "Bearish Pin", 1.2 );
AddColumn( blpin, "Bullish Pin", 1.2 );

_SECTION_END();

Sunday, 1 March 2020

তার যোগ্যতার কারনে অনেক স্মার্ট মানির পছন্দের শীর্ষে আস্তে পারে

#HAKKANIPUL- তার  যোগ্যতার কারনে অনেক স্মার্ট মানির পছন্দের শীর্ষে আস্তে পারে


চার্ট প্যাটার্ন অনুসারে এই শেয়ারেরে একটা গ্রোথ আসবে সামনে , যা সাধারণ ভাবে কারো ই চোখে পরার নয় , কারন সব কিছু সবার চোখে ধরা পরবে না এটাই স্বাভাবিক । আপনি তখই ই দেখতে পারবেন যখন এটাই বাস্তব রূপদান  হবে।

তার ব্যবসায়িক পরিসর আগের থেকে অনেক বাড়ছে , তাই এর থেকে সুফল আসবেই ...

সুফলটা হয়তো আস্তে আস্তে ভয়ংকর রূপ দান করবে এক সময় ... এখন কিন্তু তার ইফেক্ট পরতে শুরু করেছে ,কিন্তু তা আপনার চোখে এখন ধরা পরছে না । তার ইতিমদ্ধে ইপিএস এ গ্রোথ আস্তে শুরু করেছে ...। সে তার লস রিকাভার করতে শুরু করছে ... আশা করা যাচ্ছে খুব শুগ্রই তার ইপিএস এ পজেটিভ ফিগার ফিরে পাবে ।
এই শেয়ারের ফিউচার আপনার আমার কারোর পক্ষে ই প্রেডিক্ট করা সম্ভব না । কারন এই মার্কেট আর শেষটা কোথায় সেটা কেউ জানে না , এটা কেবল ডিমান্ড এন্ড সাপ্লাই আর ভীত্তিতে তার প্রাইচ নির্ধারণ করা হয়ে থাকে । এই কারনেই অনেক শেয়ারের প্রাইচ ১০ টাকার শেয়ার ২ টাকার ও নীচে এবার ১০ টাকার শেয়ার ২০০০ টাকার ও উপরে ।
এই শেয়ার এর ও একটা কাল্পনিক প্রাইচ ধরে নিলাম তিন ডিজিট (৯৯৯) টাকা । কারন আমি জানি না    তিন ডিজিট এর মধ্যে কোথায় তার অবস্থান হতেপারে আর তাই এখানে ৯৯৯ টাকা ধরে রাখলাম । দেখার বিষয় কোথায় যায় এই শেয়ার প্রাইচ । হয়তো সময় একটু বেশী নিতেই পারে কিন্তু এই শেয়ারের প্রাইচ অনেক অনেক দূরে ই যাবে । যার তার নিজের যোগ্যতায় । তার  যোগ্যতার কারনে অনেক স্মার্ট মানির পছন্দের শীর্ষে আস্তে পারে এই শেয়ারের নাম , তার তখন তাদের ইচ্ছা অনুসারে এই শেয়ারের একটা প্রাইচ নির্ধারণ করবেন , কোম্পানির ফান্ডামেন্টাল পরিবর্তনের সাথে সাথে , নতুন নতুন সিদ্ধান্তের কারনে , নতুন নতুন চুক্তির বাস্তবায়নে। সময়ের সাথে সাথে অনেক অনেক কিছু ই পরিবর্তন হতে ই পারে । তার গ্রোথ যেভাবে হতে থাকবে ......... তার সাথে সাথে তাল মিলিয়ে এই শেয়ারের প্রাইচ এ ও একটা বড় পরিবর্তন আসবে, ইনশাআল্লাহ্‌ ।।


Sunday, 24 November 2019

মার্কেট এর সাথে সাথে এই শেয়ারগুলার পজিশন ও একটু একটু করে উপরের দিকে উঠে চলছে

মার্কেট এর সাথে সাথে এই শেয়ারগুলার পজিশন ও একটু একটু করে উপরের দিকে উঠে চলছে , এমন ভাবে বাকী শেয়ার ও তার পজিশন আস্তে আস্তে এভাবেই পরিবর্তন হবে তখন আর ইনডেক্স কে মার্কেট ম্যানুপুলেটর খারাপ পজিশনে ধরে রেখে আপনাদের বিভ্রান্ত্রিতে ফেলতে পারবে না , তখন ইনডেক্স ও আপনাকে সঠিক দৃষ্টি ভঙ্গি দেতে শুরু করবে ।  

এখন যারা এগিয়ে তাদের একটা সর্ট লিস্ট দেওয়া হল ঃ


 

Thursday, 14 November 2019

Exploration Filter AFL Amibroker


One Click Market Summaries
Exploration Filter AFL Amibroker Market Explorer



To get This Exploration Filter AFL
Mail: asfatul.alam@yahoo.com

Exploration Filter AFL Amibroker





One Click Market Summaries



To get This Exploration Filter AFL 
Mail: asfatul.alam@yahoo.com

Tuesday, 29 October 2019

Chart Looks Like - Afl Amibroker

Chart Looks Like  - AFL Amibroker


If you wants This AFL
Email: asfatul.alam@yahoo.com

Sunday, 27 October 2019

WayToWin Trading System


WayToWin Trading System



If you wants This Trading System
Email: asfatul.alam@yahoo.com
 

Compare fit for Amibroker (AFL)

 Least Squares Polynomial Fit test
 comparing a least squares fit using matrix calculations
 with one that does not

Button Style Trading Control’s in Amibroker

Button Style Trading Control’s in Amibroker 




If any one wants to get This AFL Email: asfatul.alam@yahoo.com

Saturday, 26 October 2019

Fisher transform indicator AFL Amibroker



Ehlers formulas from Ehlers, John F. Cybernetic Analysis for Stocks and Futures. Wiley. 2004. Chapter 1, p. 1. Code on p. 7.

Thursday, 24 October 2019

Controlled Trailing Stop-Loss AFL Amibroker

Controlled Trailing Stop-Loss (TSL): It is necessary to ensure that TSL always goes up for Long positions and goes down for Short positions or remains constant to the previous value. "Percentage or Points" based TSLs does not account market Volatility, so it is not dynamic. "Standard Deviation" based TSL or "ATR" based TSLs are ideal. For demo using ATR based TSL here:


Here is one way to deal with daily pivots AFL Amibroker


Here is one way to deal with daily pivots:


https://drive.google.com/file/d/1_KQNmw2_RwEuPKwATKbs1hA0Nc83zwG3/view?usp=sharing

Mean band for Amibroker (AFL)



You can buy a stock when candle stick is above the band and in similar way u can sell when the candle stick is below the band…it is really a helpful AFL….


Bollinger band with entry signals AFL for Amibroker



Trading system, Amibroker, Axploration, Bands


The formula use macd and stoch astick signals with the bollinger band and moving averages for entry and exit signals