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

SMA Indicator for intraday for Amibroker (AFL)
hmsanil
almost 14 years ago
Amibroker (AFL)

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

Trailing stop loss system with SMA crossover as the entry and exit signals.

Similar Indicators / Formulas

EMA crossover
Submitted by Ketan-0 about 13 years ago
Kase Peak Osc. V2 batu
Submitted by batu1453 over 9 years ago
Kase CD V2batu
Submitted by batu1453 over 9 years ago
Ichimoku
Submitted by prashantrdx over 9 years ago
Adaptive Price Zone (APZ)
Submitted by AndrewThomas about 13 years ago
LANDIS Modified
Submitted by isfandi about 13 years ago

Indicator / Formula

Copy & Paste Friendly
SetBarsRequired( 1000, 1000 );
SetFormulaName( "Weekly SMA" );
SetTradeDelays( 1.2, 1.2, 1.2, 1.2 );
SetOption( "initialequity", 1000 );
SetOption( "CommissionMode", 2 );
SetOption( "CommissionAmount", 30 );
SetOption( "MaxOpenPositions", 20 ); //
SetOption( "AllowPositionShrinking", False );
SetOption( "AllowSameBarExit", False );

ATRLevel = 3 * ATR( 20 );

Buy = C > MA( C, 30 );

PositionSize = -10;

Sell = 0;
trailARRAY = Null;
trailstop = 0;

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

    if ( trailstop == 0 AND Buy[ i ] )
    {
        trailstop = H[ i ] - ATRLevel[ i ];
    }
    else
        Buy[ i ] = 0; // remove excess buy signals

    if ( trailstop > 0 AND Low[ i ] < trailstop )
    {
        Sell[ i ] = 1;
        SellPrice[ i ] = trailstop;
        trailstop = 0;
    }

    if ( trailstop > 0 )
    {
        trailstop = Max( H[ i ] - ATRLevel[ i ], trailstop );
        trailARRAY[ i ] = trailstop;
    }

}

Sell = trailARRAY;

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

0 comments

Leave Comment

Please login here to leave a comment.

Back