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 ....
Find Out More Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

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

Three-Bar Inside Bar Pattern for Amibroker (AFL)
EliStern
almost 7 years ago
Amibroker (AFL)

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

I have not written this code. It is written by —Tomasz Janeczko, AmiBroker.com

In ‘Three-Bar Inside Bar Pattern’ in this issue, author Johnan Prathap presents a simple trading system based on short-term candlestick patterns. Coding this system in AmiBroker Formula Language is straightforward. A ready-to-use formula for the article is shown below. To use the formula, enter it in the Afl Editor, then press the ‘Send to automatic analysis’ button. In Automatic Analysis, press the ‘Backtest’ button to perform a historical system test. Note that the formula has parameters set for the CL (crude oil) contract. You may need to modify them for testing different instruments.

Similar Indicators / Formulas

weighted moving average scan
Submitted by naninn almost 7 years ago
Kase Peak Osc. V2 batu
Submitted by batu1453 over 3 years ago
Kase CD V2batu
Submitted by batu1453 over 3 years ago
Ichimoku
Submitted by prashantrdx over 3 years ago
EMA System Ribbon
Submitted by yo123 almost 7 years ago
LANDIS Modified
Submitted by isfandi almost 7 years ago

Indicator / Formula

Copy & Paste Friendly
Cond1 = Close > Ref( Close, -1 ); 
Cond2 = High < Ref( High, -1 ) AND Low > Ref( Low, -1 ); 
Cond3 = Close < Ref( Close, -1 ); 

SetTradeDelays( 1, 1, 1, 1 ); 

Buy = Cond1 AND Ref( Cond2, -1 ) AND Ref( Cond1, -2 ); 
BuyPrice = Open; 
Short = Cond3 AND Ref( Cond2, -1 ) AND Ref( Cond3, -2 ); 
ShortPrice = Open; 

Sell = Cover = False; // exits only by stops 

// profit target being higher than loss gives better result 
// than proposed in article equal to 0.75% 
Target = 6.5; 
Loss = 0.75; // 0.75% max loss stop; 

SetOption("InitialEquity", 30000 ); 

ApplyStop( stopTypeLoss, stopModePercent, Loss, True ); 
ApplyStop( stopTypeProfit, stopModePercent, Target, True ); 

SetOption("ActivateStopsImmediately", False ); // activate stops next bar 
SetPositionSize( 1, spsShares ); 
PointValue = 1000; // big point value NYMEX CL 
MarginDeposit = 5063; // overnight margin NYMEX CL

0 comments

Leave Comment

Please login here to leave a comment.

Back