+91-0000000000

}

Monday – Friday : 9:00 AM – 6:30 PM

Jim Berg

The Jim Berg AFL could be associated with trading strategies or indicators developed by Jim Berg, a notable trader and author. It might incorporate specific technical indicators or rules for identifying trends or potential entry and exit points in the market. Utilizing an Amibroker data feed, this AFL offers tools aligned with Jim Berg’s methodologies for traders’ analysis.

/_SECTION_BEGIN("Long MA 34 week");
P = ParamField("Price field",-1);
Periods = Param("Periods", 170, 2, 200, 1 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();











_SECTION_BEGIN("jim berg volatility ATR STOP SYSTEM");
//AMIBROKER, VOLATILITY SYSTEM. Here is a sample AmiBroker chart 
//demonstrating the techniques from Jim Berg's article in this issue.


//In "The Truth About Volatility," Jim Berg presents how to use several well-known volatility measures such as average True range (ATR) to calculate entry, trailing stop, AND profit-taking levels. Implementing techniques presented in the article is very simple using the AmiBroker Formula Language (Afl), AND takes just a few lines of code. 

//Listing 1 shows the formula that the plots color-coded price chart, trailing stop, AND profit-taking lines, as well as a colored ribbon showing volatility-based entry AND exit signals. The relative strength index (RSI) used by Berg is a built-in indicator in AmiBroker, so no additional code is necessary. See Figure 3 for an example. 



//LISTING 1 
EntrySignal = C > ( LLV( L, 20 ) + 2 * ATR( 10 ) ); 
ExitSignal = C < ( HHV( H, 20 ) - 2 * ATR( 10 ) ); 
Color = IIf( EntrySignal, colorBlue, IIf( ExitSignal, colorOrange, colorGrey50 )); 
TrailStop = HHV( C - 2 * ATR(10), 15 ); 
ProfitTaker = EMA( H, 13 ) + 2 * ATR(10); 
/* plot price chart and stops */ 
Plot( TrailStop, "Trailing stop", colorBrown, styleThick | styleLine ); 
Plot( ProfitTaker, "Profit taker", colorLime, styleThick ); 
Plot( C, "Price", Color, styleBar | styleThick ); 

/* plot color ribbon */ 
Plot( 1, "", Color, styleArea | styleOwnScale | styleNoLabel, -0.1, 50 ); 

//--Tomasz Janeczko, AmiBroker.com 

//http://www.traders.com/Documentation/FEEDbk_docs/Archive/022005/TradersTips/TradersTips.html
_SECTION_END();

Open chat
1
Hi, how can I help you?