Hybrid View
-
11-09-2012 11:17 AM #1
Gold Member- Ngày tham gia
- Oct 2009
- Bài viết
- 1,925
- Được cám ơn 617 lần trong 428 bài gởi
Những series bài hay về phần mềm phân tích kỹ thuật AmiBroker
Tập hợp những bài viết đỉnh về phần mềm phân tích kỹ thuật AmiBroker
Bạn nào có bài gì hay post lên nhé
-
11-09-2012 11:18 AM #2
Gold Member- Ngày tham gia
- Oct 2009
- Bài viết
- 1,925
- Được cám ơn 617 lần trong 428 bài gởi
Phân tích kỹ thuật - AmiBroker Code
Đây là loạt bài Amibroker Code về phần mềm phân tích kỹ thuật AmiBroker
Optimization Iteration Reload (OIR) for AmiBroker
One of the (few) notable hardships of using AmiBroker is the inability to view a single optimization iteration result in a backtest or on a chart without having to manually re-enter each of the (who knows how many ...) individual strategy parameters - once thru all of them to setup a backtest, then once thru all of them again to visualize on a chart, and then all of this all over again for every single optimization iteration you want to examine.
CodeForTraders is very pleased to offer our solution to this chore - Optimization Iteration Reload for AmiBroker.
What It Is
Optimization Iteration Reload for AmiBroker is an Excel VBA application, and a process for using it, that allows you to quickly browse optimization results and choose any iteration you wish for quick, "no typing required" reloading into the AA Window parameter set or your chart parameter set.
The only modification needed to your code is the addition of a #include line, which results in the loading of the product output.
How It Works
There are just a few steps involved:
Prep your strategy code by adding the #include line
After your optimization, do a File -> Export of the AA Window results to a .csv file
Open the .csv file in Excel, and highlight the parameters for your chosen iteration
Use Alt-F8 (or your own hotkey) to invoke Optimization Iteration Reload
Return to your chart and use the Parameter Dialog reset button, or
Return to the AA Window, use the Parameter Dialog reset button, and run a backtest
The whole process takes mere seconds.
What It Looks Like
Bim, Bam, Boom - you can now easily browse any iteration of any optimization, choosing it for generation of a complete backtest report with performance graphs - NO TYPING REQUIRED !
Take a look at how it's done:
http://www.screencast.com/t/ajppho5f
-
12-08-2013 02:58 PM #3
Senior Member- Ngày tham gia
- Aug 2010
- Bài viết
- 648
- Được cám ơn 325 lần trong 218 bài gởi
Những bài viết hay nhất về phần mềm phân tích kỹ thuật PTKT AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: 52 Week New High-New Low Index
Author/Uploader: Dennis Skoblar - DennisAndLisa [at] sbcglobal.net
Date/Time added: 2005-07-11 10:14:58
Origin: Alexander Elder's book, "Trading For A Living"
Keywords: New Hi-New Low Index, 52 Week New Hi-New Low Index
Level: basic
Flags: exploration,indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:
Calculates new 52 week High's vs new 52 week lows. Input a Date 5 years back to the current Date in the Range section of the Window AND click the From button. In the Apply To section, click the Use Filter button AND click the Define > Include > Group > Stock to scan stocks ONLY. Right click on chart window,
then > Parameters > Show MiddlLe Lines - NO > Levels > +-100. Compare against the SP-500, look for convergences, divergences. Read Elder's book "Trading For A Living" pp.194-200. The new symbol "~NewHiNewLoIndex" will be found in the Workspace > Symbol > All > at the end.
Formula:
// Calculates new 52 week High's vs new 52 week lows.
// The new symbol "~NewHiNewLoIndex" will be found in the Workspace > Symbol >
All > at the end.
// Input a Date 5 years back to the current Date in the Range section of the
Window AND click the From button.
// In the Apply To section, click the Use Filter button AND click the Define >
Include > Group > Stock
// to scan stocks ONLY. Right click on chart window, then > Parameters > Show
MiddlLe Lines - NO > Levels > +-100.
// Compare against the SP-500, look for convergences, divergences. Read Elder's
book "Trading For A Living" pp.194-200.
H1 = High > Ref(HHV(High,260),-1);
L1 = Low < Ref(LLV(Low,260),-1);
HiLoDifference = H1 - L1;
Buy = 0;
Filter = 0;
AddToComposite( HiLoDifference , "~NewHiNewLoIndex", "X", atcFlagDefaults =
7);
GraphXSpace = 10;
Plot(Foreign("~NewHiNewLoIndex","C",1),"52 Week New High - New Low
Index",colorYellow,styleHistogram);
-
Những thành viên sau đã cám ơn :
tigeran (27-08-2013)
-
11-09-2012 01:30 PM #4
Member- Ngày tham gia
- Oct 2003
- Bài viết
- 365
- Được cám ơn 215 lần trong 148 bài gởi
Phân tích kỹ thuật - AmiBroker Code (tt)
Đây là loạt bài Amibroker Code về phần mềm phân tích kỹ thuật AmiBroker
RSI Indicator Suite for AmiBroker
AmiBroker offers incredible flexibility for AFL coders - but where to begin? With so much choice and power available, arriving at a standardized code organization that implements all desired features can be a real challenge.
CodeForTraders is pleased to offer the RSI Indicator Suite for AmiBroker as a low-cost, pre-written, powerful, well-organized place from which to begin (or extend) your AB journey.
What It Is
The RSI Indicator Suite for AmiBroker is 3 AFL formulas which together implement a collection of , visualization, presentation, and optimization techniques to create a complete solution for investigating RSI trading (or trading of any other indicator, after minor editing).
What It Looks Like
Observe the smoothed RSI indicator in the bottom pane. The two brighter horizontal lines (green and red) are your trade entry lines (long and short). The darker horizontal lines are the corresponding exit lines (the colors may be chosen by you).
Notice how the bars in the upper pane have been colored green during long trades, red during short trades, and white when no trades are in progress. Trade entry signal bars are indicated by the green and red arrows. All signals (buy, sell, short, cover) may be seen in the (optional) histogram display at the bottom of the price pane.
These pictures show the extensive set of parameters made available in the main formula (the one in the price pane), which is designed to provide easy control of both interactive visualization, and automatic optimization as desired.
Note the lines that start with "+++++++ ". These indicate blocks of functionality which may be switched on and off as desired for backtests and optimizations.
The lines that end with " ---------- " are individual parameters which may be set to either be optimized or "locked down" from right here in the Parameter Dialog.
Read on to learn about the many other features provided.
Video: RSI Indicator Suite - Visual Introduction
http://www.screencast.com/t/gXa08OMvz0
What It Does
The RSI Indicator Suite Package uses AmiBroker Formula Language (AFL) to implement a long list of desirable features. Each section of code is clearly marked and commented.
Included you will find:
Code for setup of cooperating indicator
Code for adding custom metric(s)
Code for AA window display of non-optimized parameters
Code for optimizer choice and setup
Code for single contract testing
Code for trading on the Open of the next bar after a Signal.
Code for technical calculation(s).
Code for trading long-only, short-only, or in both directions
Code for trading signals in the opposite direction
Code for a choice of trade signal filters
Code for limiting trading to an intraday time window
Code for optimizable indicator-based exits
Code for optimizable StopLoss and PftTgt
Code for determining and displaying exit reason
Code for histogram visualization of buy/sell/short/cover arrays.
Code for passing NetPft to cooperating display indicator in another chart pane.
Code for Displaying signals as an Exploration
Code for on-chart plotting of price, signal arrows, and trade duration/direction bar coloring
Code for creating and displaying informative title text
Code for display of filters
These features are provided in the context of a 4-level, indicator-based trading model:
Low level on the indicator (i.e weakness, oversold) for Long Entry (LE)
High level on the indicator (i.e strength, overbought) for Short Entry (SE)
Long Exit (LX) level on the indicator (for optional indicator-based long trade profit-taking)
Short Exit (SX) level on the indicator (for optional indicator-based short trade profit-taking)
For optimization, there are 8 major numeric dimensions:
RSI_Base_Period
RSI_Smooth_Period
RSI_LowLvl
RSI_HighLvl
RSI_LX_Lvl
RSI_SX_Lvl
StopLossPct
PftTgtPct
along with various other useful switches and choices.
The code uses the RSI as the provided calculation, but has been carefully constructed to allow you to easily substitute a different indicator with only very minor changes to the source.
Video: RSI Indicator Suite - Indicator Trading Model
http://www.screencast.com/t/1LzVBdEzl
Innovations
This strategy has been specially designed to allow wide-scope or narrow-scope optimization to be configured directly from the AB Parameters Dialog. This means optimization across any desired combination of the major numeric dimensions based strictly on Dialog settings without requiring code edits.
Also, custom metrics are used to ensure that non-optimized (i.e. locked-down) major dimensions are displayed in the AmiBroker Automatic window optimization results. This ensures that the report more thoroughly reflects the configuration of parameters used to generate it (which is not normally true by default).
(Note how the "locked down" RSI_Base and RSI_Smooth parameters remain unchanging throughout the optimization, yet are still part of the final display. Without them, you wouldn't know everything important about what created the performance.)
Video: RSI Indicator Suite - Flexible Optimization w/o Code Edits
http://www.screencast.com/t/jUE23rYT
You may choose to operate the code with any of the built-in AmiBroker non-exhaustive optimizers (CMAE, Tribes, SPSO). Again, no code edits required for this!
The goal of this code is to advance the new user past months of study and experimentation directly to feature-rich, working code that is both
immediately useful as-is
easily repurposed and extended
Are you a sophisticated AB user/programmer who has already written similar capabilities for yourself?
If not, CFT believes you will not find a better jump-start anywhere, at any price.
What You Get
The primary RSI-based trading formula for backtesting/optimization/display
Cooperating Net-Profit formula for separate pane display
Cooperating rRSI (remote RSI) formula, for displaying the RSI per the strategy formula settings
A .chart file for creating the window as shown above
Customer Support for initial installation.
This package is distributed as fully-disclosed AFL. You will be able to modify and extend it as desired, but you may not share it with non-licensees (just send them here instead!).
What It Costs
Only $125 for a single, permanent personal-use license. Institutional and multi-person licenses are also available (contact: questions@CodeForTraders.com).
How You Get It
Use the 'Add to Cart' button, above left, to purchase the package The package will be emailed to you after your PayPal payment is processed.
Please be aware of the caveats before you order.
-
12-08-2013 03:01 PM #5
Senior Member- Ngày tham gia
- Aug 2010
- Bài viết
- 648
- Được cám ơn 325 lần trong 218 bài gởi
Những bài viết hay nhất về phần mềm phân tích kỹ thuật PTKT AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: Absolute Breadth Index
Author/Uploader: Tomasz Janeczko - tj --at-- amibroker.com
Date/Time added: 2001-06-16 07:36:16
Origin: Originaly developed by Norman G. Fosback.
Keywords: breadth
Level: basic
Flags: indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:
The Absolute Breadth Index (ABI) is a market momentum indicator that was developed by Norman G. Fosback. The ABI shows how much activity, volatility, and change is taking place on the New York Stock Exchange while ignoring the direction prices are headed. You can think of the ABI as an "activity index". High readings indicate market activity and change, while low readings indicate lack of change. In Mr. Fosback's book, Stock Market Logic, he indicates that historically, high values typically lead to higher prices three to twelve months later.
Formula:
/*
Absolute Breadth Index
AFL implementation by Tomasz Janeczko.
*/
graph0 = abs( AdvIssues() - DecIssues() );
-
Những thành viên sau đã cám ơn :
tigeran (27-08-2013)
-
11-09-2012 03:17 PM #6
Member- Ngày tham gia
- Oct 2003
- Bài viết
- 365
- Được cám ơn 215 lần trong 148 bài gởi
Phân tích kỹ thuật - AmiBroker Code (tt)
Đây là loạt bài Amibroker Code về phần mềm phân tích kỹ thuật AmiBroker
CCI Indicator Suite for AmiBroker
The CCI (Commodity Channel Index) is an indicator with enduring popularity.
CodeForTraders is pleased to offer the CCI Indicator Suite for AmiBroker as a low-cost, pre-written, powerful, well-organized place from which to begin (or extend) your AB journey.
What It Is
The CCI Indicator Suite for AmiBroker is 3 AFL formulas which together implement a collection of , visualization, presentation, and optimization techniques to create a complete solution for investigating CCI trading (or trading of any other indicator, after minor editing).
What It Looks Like
Observe the smoothed CCI indicator in the bottom pane. The two brighter horizontal lines (green and red) are your trade entry lines (long and short). The darker horizontal lines are the corresponding exit lines (the colors may be chosen by you).
Notice how the bars in the upper pane have been colored green during long trades, red during short trades, and white when no trades are in progress. Trade entry signal bars are indicated by the green and red arrows. All signals (buy, sell, short, cover) may be seen in the (optional) histogram display at the bottom of the price pane.
These pictures show the extensive set of parameters made available in the main formula (the one in the price pane), which is designed to provide easy control of both interactive visualization, and automatic optimization as desired.
Note the lines that start with "+++++++ ". These indicate blocks of functionality which may be switched on and off as desired for backtests and optimizations.
The lines that end with " ---------- " are individual parameters which may be set to either be optimized or "locked down" from right here in the Parameter Dialog.
Read on to learn about the many other features provided.
What It Does
The CCI Indicator Suite Package uses AmiBroker Formula Language (AFL) to implement a long list of desirable features. Each section of code is clearly marked and commented.
Included you will find:
Code for setup of cooperating indicator
Code for adding custom metric(s)
Code for AA window display of non-optimized parameters
Code for optimizer choice and setup
Code for single contract testing
Code for trading on the Open of the next bar after a Signal.
Code for technical calculation(s).
Code for trading long-only, short-only, or in both directions
Code for trading signals in the opposite direction
Code for a choice of trade signal filters
Code for limiting trading to an intraday time window
Code for optimizable indicator-based exits
Code for optimizable StopLoss and PftTgt
Code for determining and displaying exit reason
Code for histogram visualization of buy/sell/short/cover arrays.
Code for passing NetPft to cooperating display indicator in another chart pane.
Code for Displaying signals as an Exploration
Code for on-chart plotting of price, signal arrows, and trade duration/direction bar coloring
Code for creating and displaying informative title text
Code for display of filters
These features are provided in the context of a 4-level, indicator-based trading model:
Low level on the indicator (i.e weakness, oversold) for Long Entry (LE)
High level on the indicator (i.e strength, overbought) for Short Entry (SE)
Long Exit (LX) level on the indicator (for optional indicator-based long trade profit-taking)
Short Exit (SX) level on the indicator (for optional indicator-based short trade profit-taking)
For optimization, there are 8 major numeric dimensions:
CCI_Base_Period
CCI_Smooth_Period
CCI_LowLvl
CCI_HighLvl
CCI_LX_Lvl
CCI_SX_Lvl
StopLossPct
PftTgtPct
along with various other useful switches and choices.
The code uses the CCI as the provided calculation, but has been carefully constructed to allow you to easily substitute a different indicator with only very minor changes to the source.
Innovations
This strategy has been specially designed to allow wide-scope or narrow-scope optimization to be configured directly from the AB Parameters Dialog. This means optimization across any desired combination of the major numeric dimensions based strictly on Dialog settings without requiring code edits.
Also, custom metrics are used to ensure that non-optimized (i.e. locked-down) major dimensions are displayed in the AmiBroker Automatic window optimization results. This ensures that the report more thoroughly reflects the configuration of parameters used to generate it (which is not normally true by default).
(Note how the "locked down" CCI_Base and CCI_Smooth parameters remain unchanging throughout the optimization, yet are still part of the final display. Without them, you wouldn't know everything important about what created the performance.)
You may choose to operate the code with any of the built-in AmiBroker non-exhaustive optimizers (CMAE, Tribes, SPSO). Again, no code edits required for this!
The goal of this code is to advance the new user past months of study and experimentation directly to feature-rich, working code that is both
immediately useful as-is
easily repurposed and extended
The CCI Indicator Suite uses the same underlying technology as the RSI Indicator Suite. Please visit that page to view video explanations of the visual features, 4-line indicator trading model, and special optimization features in action.
Though similar to our other Indicator Suite(s), the CCI Indicator Suite is offered separately
for those who prefer CCI as a primary indicator
for those who want to view exactly (with a file comparison tool) how to adapt for a different indicator
for those who want more than one ready-made, without any further edits or typing required
What You Get
The primary CCI-based trading formula for backtesting/optimization/display
Cooperating Net-Profit formula for separate pane display
Cooperating rCCI (remote CCI) formula, for displaying the CCI per the strategy formula settings
A .chart file for creating the window as shown above
Customer Support for initial installation.
This package is distributed as fully-disclosed AFL. You will be able to modify and extend it as desired, but you may not share it with non-licensees (just send them here instead!).
-
Những thành viên sau đã cám ơn :
tradingpro8x (12-08-2013)
-
12-08-2013 03:25 PM #7
Senior Member- Ngày tham gia
- Aug 2010
- Bài viết
- 648
- Được cám ơn 325 lần trong 218 bài gởi
Những bài viết hay nhất về phần mềm phân tích kỹ thuật PTKT AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: AC+ acceleration
Author/Uploader: Steve Wiser - slwiserr [at] erols.com
Date/Time added: 2001-07-05 19:08:13
Origin:
Keywords:
Level: semi-advanced
Flags: indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:
Supports William's Alligator Trend Following system
Formula:
/* Exploration, System and Indicator */
Author: Steve Wiser
Email address: slwiserr@erols.com
May 5, 2001 */
outsidebar = outside();
insidebar = H <= Ref(H,-1) and L >= Ref(L,-1);
upbar = H > ref(H,-1) and L >= ref(L, -1);
downbar = L < ref(L,-1) and H <= ref(H,-1);
barcolor=iif(outsidebar, 1,
iif(downbar, 4,
iif(upbar, 5,
iif(insidebar,6, 0 ) ) ) );
var1=ma( A , 34);
var2=ma( A,5);
var3=var2-var1;
var4=var3-ma(var3,5);
Graph0=var4;
graph0style=2+4;
Graph1=wilders(var4,5);
Graph1Style=5;
Graph0Barcolor=Barcolor;
-
Những thành viên sau đã cám ơn :
tigeran (27-08-2013)
-
11-09-2012 05:17 PM #8
Member- Ngày tham gia
- Oct 2003
- Bài viết
- 365
- Được cám ơn 215 lần trong 148 bài gởi
Phân tích kỹ thuật - AmiBroker Code (tt)
Đây là loạt bài Amibroker Code về phần mềm phân tích kỹ thuật AmiBroker
LRS Strategy Suite for AmiBroker
Linear Regression Slope is an immediately understandable measure of the direction and speed of market motion. The role of fast moves, and the potentially tradable opportunities they create, is a subject appropriate for objective study by every trader.
CodeForTraders is pleased to offer the LRS Strategy Suite for AmiBroker as a low-cost, pre-written, powerful, well-organized place from which to begin (or extend) your AB journey.
What It Is
The LRS Strategy Suite for AmiBroker is 3 AFL formulas which together implement a collection of , visualization, presentation, and optimization techniques to create a complete solution for investigating LRS trading (or trading of any other indicator, after minor editing).
What It Looks Like
Observe the raw/smoothed LRS indicator in the middle pane. In this example, the strategy has been configured to enter long where the 7-period smoothed LRS-3 dips below a threshold value of -.4, and to enter short where the 7-period smoothed LRS-3 rises above a threshold value of 2.9.
You can observe the smoothed line goes yellow when these events take place.
Notice how the bars in the upper pane have been colored green during long trades, red during short trades, and white when no trades are in progress. Trade entry signal bars are indicated by the green and red arrows. All signals (buy, sell, short, cover) may be seen in the (optional) histogram display at the bottom of the price pane.
These pictures show the extensive set of parameters made available in the main formula (the one in the price pane), which is designed to provide easy control of both interactive visualization, and automatic optimization as desired.
Note the lines that start with "+++++++ ". These indicate blocks of functionality which may be switched on and off as desired for backtests and optimizations.
The lines that end with " ---------- " are individual parameters which may be set to either be optimized or "locked down" from right here in the Parameter Dialog.
Read on to learn about the many other features provided.
For insight into the flexibility and convenience of the LRS Suite, please view this RSI Suite video, which introduces the technology in use:
Video: RSI Strategy Suite - Visual Introduction
What It Does
The LRS Strategy Suite Package uses AmiBroker Formula Language (AFL) to implement a long list of desirable features. Each section of code is clearly marked and commented.
Included you will find:
Code for setup of cooperating indicator
Code for adding custom metric(s)
Code for AA window display of non-optimized parameters
Code for optimizer choice and setup
Code for single contract testing
Code for trading on the Open of the next bar after a Signal.
Code for technical calculation(s).
Code for trading long-only, short-only, or in both directions
Code for trading signals in the opposite direction
Code for a choice of trade signal filters
Code for limiting trading to an intraday time window
Code for optimizable indicator-based exits
Code for optimizable StopLoss, ProfitTgt, and TrailingStop
Code for determining and displaying exit reason
Code for histogram visualization of buy/sell/short/cover arrays.
Code for passing NetPft to cooperating display indicator in another chart pane.
Code for Displaying signals as an Exploration
Code for on-chart plotting of price, signal arrows, and trade duration/direction bar coloring
Code for creating and displaying informative title text
Code for display of filters
These features are provided in the context of a 4-level, indicator-based trading model:
Low level on the indicator (i.e weakness, oversold) for Long Entry (LE)
High level on the indicator (i.e strength, overbought) for Short Entry (SE)
Long Exit (LX) level on the indicator (for optional indicator-based long trade profit-taking)
Short Exit (SX) level on the indicator (for optional indicator-based short trade profit-taking)
For optimization, there are 9 major numeric dimensions:
LRS_Base_Period
LRS_Smooth_Period
LRS_LowLvl
LRS_HighLvl
LRS_LX_Lvl
LRS_SX_Lvl
StopLossPct
PftTgtPct
TrailingStopPct
along with various other useful switches and choices.
The code uses the LRS as the provided calculation, but has been carefully constructed to allow you to easily substitute a different indicator with only very minor changes to the source.
For a visual explanation of the features and use of the 4-line indicator trading model, please see this video, originally prepared for the RSI Strategy Suite:
Video: RSI Strategy Suite - Indicator Trading Model
Innovations
This strategy has been specially designed to allow wide-scope or narrow-scope optimization to be configured directly from the AB Parameters Dialog. This means optimization across any desired combination of the major numeric dimensions based strictly on Dialog settings without requiring code edits.
Also, custom metrics are used to ensure that non-optimized (i.e. locked-down) major dimensions are displayed in the AmiBroker Automatic window optimization results. This ensures that the report more thoroughly reflects the configuration of parameters used to generate it (which is not normally true by default).
(Note how the "locked down" LRS_Base and LRS_Smooth parameters remain unchanging throughout the optimization, yet are still part of the final display. Without them, you wouldn't know everything important about what created the performance.)
For a visual explanation of the flexible optimization implementation, please see this video, originally prepared for the RSI Strategy Suite:
Video: RSI Strategy Suite - Flexible Optimization w/o Code Edits
You may choose to operate the code with any of the built-in AmiBroker non-exhaustive optimizers (CMAE, Tribes, SPSO). Again, no code edits required for this!
The goal of this code is to advance the new user past months of study and experimentation directly to feature-rich, working code that is both
immediately useful as-is
easily repurposed and extended
Are you a sophisticated AB user/programmer who has already written similar capabilities for yourself?
If not, CFT believes you will not find a better jump-start anywhere, at any price.
What You Get
The primary LRS-based trading formula for backtesting/optimization/display
Cooperating Net-Profit formula for separate pane display
Cooperating rLRS (remote LRS) formula, for displaying the LRS per the strategy formula settings
A .chart file for creating the window as shown above
Customer Support for initial installation.
This package is distributed as fully-disclosed AFL. You will be able to modify and extend it as desired, but you may not share it with non-licensees (just send them here instead!).
-
Những thành viên sau đã cám ơn :
tradingpro8x (12-08-2013)
-
12-08-2013 03:31 PM #9
Senior Member- Ngày tham gia
- Aug 2010
- Bài viết
- 648
- Được cám ơn 325 lần trong 218 bài gởi
Những bài nghiên cứu chuyên sâu về phần mềm phân tích kỹ thuật PTKT AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: accum/dist mov avg crossover SAR
Author/Uploader: Jeff Parent - (email hidden)
Date/Time added: 2002-07-31 16:21:24
Origin:
Keywords: accumulation distribution volume SAR
Level: semi-advanced
Flags: indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:
Similar to a volume weighted price support/resistance line, uses the accumulation / distribution indicator to set stop line. vbscript required to calculate variable lookback period.
Formula:
EnableScript("vbscript");
<%
function jMA(jH,jL,A2,A2m,k)
dim result()
redim result(UBound(jH))
for i=k to UBound(jH)
n=i+1
if A2(i)<= A2m(i) then
do until n=0
n=n-1
if A2(n)>= A2m(i) then exit do
Loop
result(i)=jH(n)
else
do until n=0
n=n-1
if A2(n)<= A2m(i) then exit do
Loop
result(i)=jL(n)
end if
next
jMA=result
end function
%>
script=GetScriptObject();
n=60;
Graph0=script.jMA(H,L,AccDist(),EMA(AccDist(),n),n );
Graph1=C;
Graph1Style=128;
Graph2=IIf(C<MA(C,n),MA(H,n),MA(L,n));Graph2Style= 1;
-
Những thành viên sau đã cám ơn :
tigeran (27-08-2013)
-
12-09-2012 08:03 AM #10
Member- Ngày tham gia
- Oct 2003
- Bài viết
- 365
- Được cám ơn 215 lần trong 148 bài gởi
Phân tích kỹ thuật - AmiBroker Code (tt)
Đây là loạt bài Amibroker Code về phần mềm phân tích kỹ thuật AmiBroker
ZigZag Strategy Suite for AmiBroker
The market Zigs and Zags, and this is a perennial source of fascination for traders. Does movement predict more movement? Should movement be faded? These are fundamental questions of tendency for any market and timeframe which can only be answered by testing.
CodeForTraders is pleased to offer the ZigZag Strategy Suite for AmiBroker as a low-cost, pre-written, powerful, well-organized place from which to begin (or extend) your AB journey.
What It Is
The ZigZag Strategy Suite for AmiBroker is 2 AFL formulas which together implement a collection of , visualization, presentation, and optimization techniques to create a complete solution for investigating ZigZag trading.
What It Looks Like
Observe the price bars with the overlayed ZigZag lines in the page below. In this example, the strategy has been configured to enter with the latest movement of at least 2% in either direction. (Calculations are retrospective for , not intended for real-time trading.)
Notice how the bars have been colored green during long trades and red during short trades (they will be white when no trades are in progress). Trade entry signal bars are indicated by the green and red arrows. All signals (buy, sell, short, cover) may be seen in the (optional) histogram display at the bottom of the price pane.
These pictures show the extensive set of parameters made available in the main formula (the one in the price pane), which is designed to provide easy control of both interactive visualization, and automatic optimization as desired.
Note the lines that start with "+++++++ ". These indicate blocks of functionality which may be switched on and off as desired for backtests and optimizations.
The lines that end with " ---------- " are individual parameters which may be set to either be optimized or "locked down" from right here in the Parameter Dialog.
Read on to learn about the many other features provided.
For insight into the flexibility and convenience of the ZigZag Suite, please view this video, which introduces the technology in use:
Video: ZZ Strategy Suite - Visual Introduction
What It Does
The ZigZag Strategy Suite Package uses AmiBroker Formula Language (AFL) to implement a long list of desirable features. Each section of code is clearly marked and commented.
Included you will find:
Code for adding custom metric(s)
Code for AA window display of non-optimized parameters
Code for optimizer choice and setup
Code for single contract testing
Code for trading on the Open of the next bar after a Signal.
Code for technical calculation(s).
Code for trading long-only, short-only, or in both directions
Code for trading signals in the opposite direction (fade the ZZ)
Code for a choice of trade signal filters
Code for limiting trading to an intraday time window
Code for optimizable StopLoss, ProfitTgt, and TrailingStop
Code for determining and displaying exit reason
Code for histogram visualization of buy/sell/short/cover arrays.
Code for passing NetPft to cooperating display indicator in another chart pane.
Code for Displaying signals as an Exploration
Code for on-chart plotting of price, signal arrows, and trade duration/direction bar coloring
Code for creating and displaying informative title text
Code for display of filters
These features are provided in the context of a Zig-Zag indicator-based trading model:
Trade with new legs of market movement
Trade against new legs of market movement
For optimization, there are 4 major numeric dimensions:
ZigZag_PctChg
StopLossPct
PftTgtPct
TrailingStopPct
along with various other useful switches and choices.
The code uses the ZigZag as the provided calculation and provides built-in display of the relevant pivot points and ZZ legs per your ZigZag_PctChg setting.
Innovations
This strategy has been specially designed to allow wide-scope or narrow-scope optimization to be configured directly from the AB Parameters Dialog. This means optimization across any desired combination of the major numeric dimensions based strictly on Dialog settings without requiring code edits.
Also, custom metrics are used to ensure that non-optimized (i.e. locked-down) major dimensions are displayed in the AmiBroker Automatic window optimization results. This ensures that the report more thoroughly reflects the configuration of parameters used to generate it (which is not normally true by default).
(Note how the "locked down" Mode, Filter, etc. parameters remain unchanging throughout the optimization, yet are still part of the final display. Without them, you wouldn't know everything important about what created the performance.)
For a visual explanation of the flexible optimization implementation, please see this video, originally prepared for the RSI Strategy Suite:
Video: RSI Strategy Suite - Flexible Optimization w/o Code Edits
You may choose to operate the code with any of the built-in AmiBroker non-exhaustive optimizers (CMAE, Tribes, SPSO). Again, no code edits required for this!
The goal of this code is to advance the new user past months of study and experimentation directly to feature-rich, working code that is both
immediately useful as-is
easily repurposed and extended
Are you a sophisticated AB user/programmer who has already written similar capabilities for yourself?
If not, CFT believes our ZigZag Strategy Suite is the most feature-rich, flexible, and easy-to-use code for the study of ZigZags available anywhere.
What You Get
The primary ZigZag-based trading formula for backtesting/optimization/display
Cooperating Net-Profit formula for separate pane display
A .chart file for creating the window as shown above
Customer Support for initial installation.
This package is distributed as fully-disclosed AFL. You will be able to modify and extend it as desired, but you may not share it with non-licensees (just send them here instead!).
-
Những thành viên sau đã cám ơn :
tradingpro8x (12-08-2013)
-
12-08-2013 03:34 PM #11
Senior Member- Ngày tham gia
- Aug 2010
- Bài viết
- 648
- Được cám ơn 325 lần trong 218 bài gởi
Những bài nghiên cứu chuyên sâu về phần mềm phân tích kỹ thuật PTKT AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: AccuTrack
Author/Uploader: Salil V Gangal - salil_gangal [at] yahoo.com
Date/Time added: 2003-09-12 12:50:01
Origin: FastTrack
Keywords: AccuTrack
Level: basic
Flags: indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:
// AccuTrack Compares performance of two securities
// The basic idea is to switch between the two securities
// AccuTrack was developed by FastTrack (fasttrack.net)
Formula:
// AccuTrack Compares performance of two securities
// The basic idea is to switch between the two securities
// AccuTrack was developed by FastTrack (http://fasttrack.net)
// Following is the Indicator Builder Formula
fnd = Name();
ind = "FDRXX"; // FDRXX is money market fund, so the comparison is done
with cash.
fund = Foreign(fnd, "Close");
index = Foreign(ind, "Close");
fast = 6;
slow = 24;
RawAT = EMA((EMA(ROC(fund,1), slow) - EMA(ROC(index,1),slow)),fast);
tradeAccuTrack = RawAT * 265;
Plot(tradeAccuTrack, "tradeAccuTrack", colorBlue, styleLine);
Title = Date()
+ " Trade AccuTrack of "
+ fnd
+" / "
+ ind
+ " = " + WriteVal(tradeAccuTrack, 1.2) + " ";
GraphXSpace = 2;
-
Những thành viên sau đã cám ơn :
tigeran (27-08-2013)
-
12-09-2012 11:35 AM #12
Senior Member- Ngày tham gia
- Aug 2010
- Bài viết
- 648
- Được cám ơn 325 lần trong 218 bài gởi
Những series bài hay về phần mềm phân tích kỹ thuật AmiBroker
Đây là loạt bài Simple and Useful Codes về phần mềm phân tích kỹ thuật AmiBroker
Please post in this thread simple codes which enhance default charts.
As a start, attaching afl which marks the values at highs/lows.
Code:
_SECTION_BEGIN("Show Values at H&L");
n=Param("Values back",20,1,200,1);
p=Param("zig %",5,1,100,1);
dist = 0.8*ATR(15);
for( i = 1; i < n; i++ )
**
PlotText(""+LastValue(Peak(H,p,i),True),BarCount-3-LastValue(PeakBars(H,p,i)),LastValue(dist,True)+La stValue(Peak(H,p,i),False),colorblue,ColorRGB(225, 225,225));
PlotText(""+LastValue(Trough(L,p,i),True),BarCount-3-LastValue(TroughBars(L,p,i)),LastValue(Trough(L,p, i),False)-LastValue(dist,True),colorblue,ColorRGB(225,225,22 5));
}
_SECTION_END();
This code could be useful for scalpers, gives the time left in completion of the current bar (in seconds).
Code:
_SECTION_BEGIN("Time Left");
function GetSecondNum()
**
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
return SecondNum;
}
RequestTimedRefresh( 1 );
TimeFrame = Interval();
SecNumber = GetSecondNum();
Newperiod = SecNumber % TimeFrame == 0;
SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
SecsToGo = TimeFrame - SecsLeft;
x=Param("xposn",918,0,1000,1);
y=Param("yposn",586,0,1000,1);
GfxSelectSolidBrush( ColorRGB( 230, 230, 230 ) );
GfxSelectPen( ColorRGB( 230, 230, 230 ), 2 );
if ( NewPeriod )
**
GfxSelectSolidBrush( colorYellow );
GfxSelectPen( colorYellow, 2 );
Say( "New period" );
}
GfxRoundRect( x+55, y+17, x-4, y-2, 0, 0 );
GfxSetBkMode(1);
GfxSelectFont( "Arial", 9, 700, False );
GfxSetTextColor( colorBlack );
GfxTextOut( ""+SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );
_SECTION_END();
-
12-08-2013 03:37 PM #13
Senior Member- Ngày tham gia
- Aug 2010
- Bài viết
- 648
- Được cám ơn 325 lần trong 218 bài gởi
Kinh nghiệm phân tích kỹ thuật PTKT chứng khoán bằng AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: Adaptave Zones O/B & O/S Oscillator
Author/Uploader: Anthony Faragasso - ajf1111 [at] epix.net
Date/Time added: 2001-12-27 10:22:54
Origin:
Keywords:
Level: medium
Flags: indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:
Automatically Adjusts the Overbought and Oversold levels based on past performance.( Lookback ).
Set up to be used with AmiBroker PrePackaged indicators,RSI,CCI,STOCHK,STOCHD,MFI,ULTIMATE,ROC,
Also, Added RSI of MACD indicator.
User Friendly, Set with Vairable Identifiers and information in the title as to what indicator is being studied.
A1=RSIt; B2=RSI(pds); C3=CCI(pds); D4=StochK(pds); E5=StochD(pds);
F6=MFI(pds); G7=Ultimate(pds); H8=ROC(C,pds);
Osc=C3; /*insert variable by Identifier*/
Further Improvements will be Added to Enhance.
Formula:
/*Adaptive Zones OB/OS OSCILLATOR*/
/*Automatically Adjusts the overbought and oversold levels based on past
performance*/
/*Interpreted and coded by Anthony Faragasso*/
/*Can be used with PrePackaged
indicators,RSI,CCI,STOCHK,STOCHD,MFI,ULTIMATE,*/
/*For ROC add the Close. ex.ROC(C,pds);*/
MaxGraph=10;
/*Input */
Lookback=60;
PerCent=95;
Pds =14;
/****Dimitri Code***********/
/*14-Day RSI of MACD()*/
//t=14; Replaced with pds= statement
Var=MACD();
Up=IIf(Var>Ref(Var,-1),abs(Var-Ref(Var,-1)),0);
Dn=IIf(Var<Ref(Var,-1),abs(Var-Ref(Var,-1)),0);
Ut=Wilders(Up,Pds);
Dt=Wilders(Dn,Pds);
RSIt=100*(Ut/(Ut+Dt));
/************End Code*************************/
/*******Variables******************/
A1=RSIt; B2=RSI(pds); C3=CCI(pds); D4=StochK(pds); E5=StochD(pds);
F6=MFI(pds); G7=Ultimate(pds); H8=ROC(C,pds);
Osc=C3; /*insert variable by Identifier*/
/*Value of Osc*/
Value1 = Osc;
/*Highest AND Lowest Values of Osc during Lookback Period*/
Value2 = HHV(Value1,Lookback);
Value3 = LLV(Value1,Lookback);
/*Range of Osc during Lookback Period*/
Value4 = Value2 - Value3;
/*Define PerCent of Range to determine OB AND OS levels*/
Value5 = Value4 * (PerCent / 100);
/*Calculate OB AND OS levels*/
Value6 = Value3 + Value5;
Value7 = Value2 - Value5;
baseline=IIf( Osc < 100 AND Osc > 10 ,50 ,IIf( Osc < 0 ,0,0));
Header=WriteIf(Osc==A1," RSI Of MACD",WriteIf(Osc==b2," RSI",WriteIf(Osc==C3,"
CCI",WriteIf(Osc==D4,"STOCHK",WriteIf(Osc==E5,"STO CHD",WriteIf(Osc==F6," MONEY
FLOW INDEX",WriteIf(Osc==G7," ULTIMATE",WriteIf(Osc==H8,"
ROC(CLOSE)",""))))))));
Plot(Value1, Header,6,1+4); /*BLUE*/
Plot(Value6," O/B",4,1+4); /*RED -TOP(SELL)*/
Plot(Value7," O/S",5,1+4); /*GREEN-BOT(BUY)*/
Plot(Baseline," Baseline",7,1+4); /* yellow*/
Vài dòng nhận xét:
*******Adaptive Zones OB/OS OSCILLATOR********
1. Automatically Adjusts the Overbought and Oversold levels based on past performance.( Lookback ).
The closer the lookback period ( ex. 25, which I like with the RSI ) the more responsive the Zones become.( short term trading ).
2. You can set the sensitivity of the Zones.( ex. 95, 85,80, etc.) Percent. Then interpret the signals as you would with other oscillators.
a) Buy when the oscillator falls below a specific level and then rises above that level.
b) Sell when the oscillator rises above a specific level and then falls below that level.
c) Look for Divergences. ( Ex. When prices are making a series of new highs and the oscillator is failing to surpass it previous highs.
3. Instead of the arbitrary ( 30,70 ) , ( 20,80 ) etc. The Adaptive Zones Automatically adjust the OverBought and OverSold Levels Based on past performance of
the derivitive , which is set with the Lookback Variable ( 60 or closer( 25), seems to give a good interpretation of
current market conditions ) and your Percent setting, giving optimal o/b and o/s levels.
A setting of percent=95, is extreme Buy and sell levels, When the oscillator touches the Top
zone and then Turn down ( Possible Sell ), and when the oscillator touches the Bottom Zone
and Turns up ( Possible Buy ).
4. If Oscillator is continually above the Baseline, market in an uptrend, If Oscillator is continually
Below the Baseline, Market in a Downtrend.
-
Những thành viên sau đã cám ơn :
tigeran (27-08-2013)
-
12-09-2012 02:03 PM #14
Senior Member- Ngày tham gia
- Aug 2010
- Bài viết
- 648
- Được cám ơn 325 lần trong 218 bài gởi
Những series bài hay về phần mềm phân tích kỹ thuật AmiBroker
Đây là loạt bài Simple and Useful Codes về phần mềm phân tích kỹ thuật AmiBroker
Zig-zag function of Metastock in AmiBroker
//This is simply naming the code section
_SECTION_BEGIN("Show Values at H&L");
//asking user to input the maximum no. of bars n on which the values will be plotted
n=Param("Values back",20,1,200,1);
/*Zig is a common function which calculates the hi/lo based on minimum % movement (p)*/
p=Param("zig %",5,1,100,1);
//dist is used for proper plotting of hi/lo values
dist = 0.8*ATR(15);
//looping required in amibroker to plot on all bars which are drawn on chart
for( i = 1; i < n; i++ )
**
/*for plottext function refer here: http://www.tradinganalysis.co.in/Ami.../plottext.html */
PlotText(""+LastValue(Peak(H,p,i),True),BarCount-3-LastValue(PeakBars(H,p,i)),LastValue(dist,True)+La stValue(Peak(H,p,i),False),colorblue,ColorRGB(225, 225,225));
PlotText(""+LastValue(Trough(L,p,i),True),BarCount-3-LastValue(TroughBars(L,p,i)),LastValue(Trough(L,p, i),False)-LastValue(dist,True),colorblue,ColorRGB(225,225,22 5));
}
_SECTION_END();
An excel report of the High Low
1. Go to ->automatic and pick afl containing the following code:
Code:
Change= 5;
Filter= C;
AddColumn(Trough(L,Change,1), "Low");
AddColumn(Peak(H,Change,1), "Hi");
Please note 'change' is the minimum % change which the zig function uses to calculate hi/lo
2. Select 'current symbol' and hit 'explore' button. It gives you a table for a particular date and the most recent hi/lo corresponding to that date.
3. To copy result to XL, select all->copy and then paste into a xl sheetLast edited by tradingpro8x; 12-09-2012 at 02:07 PM.
-
27-08-2013 03:19 PM #15
Gold Member- Ngày tham gia
- Oct 2009
- Bài viết
- 1,925
- Được cám ơn 617 lần trong 428 bài gởi
Kinh nghiệm phân tích kỹ thuật PTKT chứng khoán bằng MetaStock & AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: Adaptive Centre of Gravity
Author/Uploader: Robert Dunbar - (email hidden)
Date/Time added: 2012-07-16 08:45:48
Origin: London
Keywords: Adaptive Centre of Gravity, John Ehler
Level: medium
Flags: indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:
You can contact me at "info at coding4ab dot com"
Formula:
//==================================
//==================================
// From John Ehler's book ===
// Rocket Science for Traders ===
// ===
// AFL By Robert Dunbar ===
//==================================
//==================================
Arrows = ParamToggle( "Buy/Sell Arrows", "No|Yes", 1 );
PriceIn = ( ( H + L ) / 2 );
Alpha = Param( "Alpha", 0.07, 0.01, 0.4, 0.01, 0.01 );
CG = BullSig = BearSig = Trigger = Cycle = InstPeriod = Period = DeltaPhase =
0;
SmoothX = ( PriceIn + 2 * Ref( PriceIn, -1 ) + 2 * Ref( PriceIn, -2 ) + Ref(
PriceIn, -3 ) ) / 6;
for ( i = 10; i < BarCount; i++ )
Cycle[i] = ( ( 1 - 0.5 * alpha ) ^ 2 ) * ( SmoothX[ i ] - 2 * SmoothX[ i -
1 ] + SmoothX[ i - 2] ) + 2 * ( 1 - alpha ) * Cycle[ i - 1 ] - ( ( 1 - alpha ) ^
2 ) * Cycle[ i - 2 ];
Q1[i] = ( .0962 * cycle[i] + .5769 * cycle[i-2] - .5769 * cycle[i-4] -
.0962 * cycle[i-6] ) * ( .5 + .08 * InstPeriod[i-1] );
I1[i] = cycle[i-3];
if ( Q1[i] != 0 AND Q1[i-1] != 0 )
DeltaPhase[i] = ( I1[i] / Q1[i] - I1[i-1] / Q1[i-1] ) / ( 1 + I1[i] *
I1[i-1] / ( Q1[i] * Q1[i-1] ) );
if ( DeltaPhase[i] < 0.1 )
DeltaPhase[i] = 0.1;
if ( DeltaPhase[i] > 1.1 )
DeltaPhase[i] = 1.1;
mlen = 5;
for ( k = mlen - 1; k >= 0; k-- )
temparray[k] = DeltaPhase[i + k - ( mlen - 1 )];
}
temp = 0;
for ( k = mlen - 1; k > 0; k-- )
for ( j = mlen - 1; j > 0; j-- )
if ( temparray[j-1] > temparray[j] )
temp = temparray[j-1];
temparray[j-1] = temparray[j];
temparray[j] = temp;
}
}
}
MedianDelta[i] = temparray[mlen - 1 - ( mlen / 2 )];
if ( MedianDelta[i] == 0 )
DC[i] = 15;
else
DC[i] = 6.28318 / MedianDelta[i] + .5;
InstPeriod[i] = .33 * DC[i] + .67 * InstPeriod[i-1];
Period[i] = .15 * InstPeriod[i] + .85 * Period[i-1];
IntPeriod[i] = int( Period[i] / 2 );
num = 0;
denom = 0;
for ( j = 0; j < intPeriod[i]; j++ )
num = num + ( 1 + j ) * PriceIn[i - j];
denom = denom + PriceIn[i - j];
}
if ( denom != 0 )
CG[i] = -num / denom + ( IntPeriod[i] + 1 ) / 2;
}
Trigger = Ref( CG, -1 );
BullSig = IIf( Cross( CG, Trigger ), True, False );
BearSig = IIf( Cross( Trigger, CG ), True, False );
Plot( CG, "Adaptive_CG", colorLightBlue, styleLine );
Plot( Trigger, "Trigger", colorRed, styleLine );
Plot( 0 , "", colorWhite, styleDashed );
if ( Arrows )
PlotShapes( shapeUpArrow*BullSig, colorBrightGreen );
PlotShapes( shapeDownArrow*BearSig, colorRed );
}
-
15-09-2012 06:25 PM #16
Member- Ngày tham gia
- Oct 2003
- Bài viết
- 365
- Được cám ơn 215 lần trong 148 bài gởi
Những series bài hay về phần mềm PTKT phân tích kỹ thuật AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: Pivots And Prices And Swing Volume
Author/Uploader: reinsley - (email hidden)
Date/Time added: 2010-04-21 03:54:16
Origin:
Keywords: volume swing pivot
Level: basic
Flags: indicator
Description:
// Volume cum
// cumulate the volume for each swing
// by reinsley
// Following the S&C "Price+Volume=Price movement by Tom ORD
// S&C's document is stored in Yahoo! Group files and
// posted in user's list
// Mod of Pivots And Prices formula
Formula:
// Volume cum
//----------------------------------------------------------
// cumulate the volume for each swing
// by reinsley
// Following the S&C "Price+Volume=Price movement by Tom ORD
// S&C's document is stored in Yahoo! files
// Mod of the Pivots And Prices formula
//----------------------------------------------------------
_SECTION_BEGIN( "Price" );
_N( Title = StrFormat( "**{NAME}} - **{INTERVAL}} **{DATE}} \nOpen %g \nHigh %g
\nLow %g \nClose %g (%.1f%%) **{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )
) ) );
Plot( C, "", colorBlack , styleCandle );
_SECTION_END();
_SECTION_BEGIN( "pivot" );
price = ParamToggle( "Plot Price", "Off|On", 1 );
num = Param( "trend", 4, 1, 10, 1 );
dist = 0.5 * ATR( 10 );
rightfig = Param( "rightfig ", 7, 1, 10, 1 );
xspace = Param( "GraphXSpace ", 10, 1, 20, 1 );
mHHV = HHV( H, num );
mLLV = LLV( L, num );
FirstVisibleBar = Status( "FirstVisibleBar" );
Lastvisiblebar = Status( "LastVisibleBar" );
for ( b = Firstvisiblebar + num; b <= Lastvisiblebar AND b < BarCount - num;
b++ )
**
i = num;
ml = 0;
mu = 0;
while ( i > 0 )
**
if ( L[b] < L[b+i] )
**
ml++;
}
if ( H[b] > H[b+i] )
**
mu++;
}
i--;
}
if ( ml == num AND L[B] == mLLV[B] )
**
PlotText( "\n *\n", b, L[b], colorGreen );
if ( price == 1 )
**
p = StrRight( NumToStr( L[b], 4.1 ), rightfig );
PlotText( "\n\n" + p, b - 2 , L[b] , colorGreen );
}
}
if ( mu == num AND H[B] == mHHV[B] )
**
PlotText( " *\n", b, H[b], colorRed );
if ( price == 1 )
**
p = StrRight( NumToStr( H[b], 4.1 ), rightfig );
PlotText( p , b - 2 , H[b] + dist[b] + 1, colorRed );
}
}
}
_SECTION_END();
// Vertical Daily Segment
segments = IIf( Interval() < inDaily, Day(), Month() );
segments = segments != Ref( segments , -1 );
Plot( segments, "", colorDarkBlue, styleHistogram | styleOwnScale | styleDashed
| styleNoLabel );
/*
Volbar = TimeFrameGetPrice( "V", in1Minute * 20, 0 );
_TRACE( "Volbar = " + Volbar );
*/
// Seconds Remaining
function GetSecondNum()
**
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
return SecondNum;
}
RequestTimedRefresh( 1 );
TimeFrame = Interval();
SecNumber = GetSecondNum();
SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
SecsToGo = TimeFrame - SecsLeft;
Secsleft = SecsToGo % 60 ;
Minleft = int( SecsToGo / 60 );
//Title = Title +"\n\\c07Min " + Minleft + "\n\\c05Secs " + Secsleft ;
Title = Title + "\n\\c07 " + Minleft + "\\c07 : " + "\\c07 " + Secsleft ;
// Zig-Hi-Zag-Lo formula
VolON = ParamToggle( "Plot Volume", "Off|On", 1 );
ZigON = ParamToggle( "Plot Zig", "Off|On", 1 );
pr = Param( "ZigZag change amount", 0.3, 0.05, 20, 0.05 );
pk = PeakBars( H, pr ) == 0;
tr = TroughBars( L, pr ) == 0;
zzHi = Zig( H, pr );
zzLo = Zig( L, pr );
Avg = ( zzHi + zzLo ) / 2;
x = IIf( pk, zzHi, IIf( tr, zzLo, IIf( Avg > Ref( Avg, -1 ), H, L ) ) );
zzHiLo = Zig( x, pr );
zzup = zzHiLo > Ref( zzHiLo, -1 ) ;
zzdn = zzHiLo < Ref( zzHiLo, -1 );
ribboncol = IIf( zzup , colorWhite, colorBlack );
// Plot the Zig ribbon
Plot ( 1, "", ribboncol, styleArea | styleOwnScale | styleNoLabel, 0, 100 );
if ( ZigON == 1 )
Plot( zzHiLo, "", ribboncol , styleNoLabel );
//Swing Volume
Volswing = Sum( V, BarsSince( zzup != Ref( zzup, -1 ) ) + 1 );
SwingBar = BarsSince( zzHiLo != Ref( zzHiLo, -1 ) );
// plot Volume at 5% from bottom's pane
percent = Param( "PositTextVol%", 5, 2, 90, 0.5 );
xshift = Param( "xshift %", 4, 1, 90, 0.5 );
yshift = Param( "yshift %", 3, 1, 90, 0.5 );
Miny = Status( "axisminy" );
Maxy = Status( "axismaxy" );
y = Miny + ( Maxy - Miny ) * percent / 100; // at 5 % above bottom of the
pane
FirstVisibleBar = Status( "FirstVisibleBar" );
Lastvisiblebar = Status( "LastVisibleBar" );
for ( i = Firstvisiblebar + 1; i <= Lastvisiblebar AND i < BarCount - 1; i++ )
**
if ( zzup [i] AND zzup [ i+1] == 0 )
**
if ( VolON == 1 )
**
PlotText( "" + Volswing [ i] , i - xshift , H[i] + yshift ,
colorWhite );
}
}
if ( zzup [i] == 0 AND zzup [ i+1] == 1 )
**
if ( VolON == 1 )
**
PlotText( "" + Volswing [ i] , i - xshift , L[i] - yshift ,
colorBlack );
}
}
}
if ( VolON == 1 )
**
PlotText( "" + Volswing , i + 2 , zzHiLo[BarCount-1], LastValue( ribboncol
) );
}
GraphXSpace = xspace;
-
Những thành viên sau đã cám ơn :
tradingpro8x (12-08-2013)
-
27-08-2013 03:21 PM #17
Gold Member- Ngày tham gia
- Oct 2009
- Bài viết
- 1,925
- Được cám ơn 617 lần trong 428 bài gởi
Kinh nghiệm phân tích kỹ thuật PTKT chứng khoán bằng MetaStock & AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: Adaptive Cyber Cycle
Author/Uploader: Robert Dunbar - (email hidden)
Date/Time added: 2012-07-16 08:46:42
Origin: London
Keywords: Adaptive Cyber Cycle, John Ehler
Level: medium
Flags: indicator
DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:
You can contact me at "info at coding4ab dot com"
Formula:
//==================================
//==================================
// From John Ehler's book ===
// Rocket Science for Traders ===
// ===
// AFL By Robert Dunbar ===
//==================================
//==================================
Arrows = ParamToggle( "Buy/Sell Arrows", "No|Yes", 1 );
PriceIn = ( ( H + L ) / 2 );
alpha = Param( "Alpha", 0.07, 0.01, 0.4, 0.01, 0.01 );
Len = Param( "Length", 8, 1, 25, 1, 1 );
BullSig = BearSig = Trigger = Cycle = InstPeriod = Period = AdaptCycle =
DeltaPhase = 0;
SmoothX = ( PriceIn + 2 * Ref( PriceIn, -1 ) + 2 * Ref( PriceIn, -2 ) + Ref(
PriceIn, -3 ) ) / 6;
for ( i = 6; i < BarCount; i++ )
Cycle[i] = ( ( 1 - 0.5 * alpha ) ^ 2 ) * ( SmoothX[ i ] - 2 * SmoothX[ i -
1 ] + SmoothX[ i - 2] ) + 2 * ( 1 - alpha ) * Cycle[ i - 1 ] - ( ( 1 - alpha ) ^
2 ) * Cycle[ i - 2 ];
Q1[i] = ( .0962 * cycle[i] + .5769 * cycle[i-2] - .5769 * cycle[i-4] -
.0962 * cycle[i-6] ) * ( .5 + .08 * InstPeriod[i-1] );
I1[i] = cycle[i-3];
if ( Q1[i] != 0 AND Q1[i-1] != 0 )
DeltaPhase[i] = ( I1[i] / Q1[i] - I1[i-1] / Q1[i-1] ) / ( 1 + I1[i] *
I1[i-1] / ( Q1[i] * Q1[i-1] ) );
if ( DeltaPhase[i] < 0.1 )
DeltaPhase[i] = 0.1;
if ( DeltaPhase[i] > 1.1 )
DeltaPhase[i] = 1.1;
//----- Speed up the median calculation by placing it inline
mlen = 5;
for ( k = mlen - 1; k >= 0; k-- )
temparray[k] = DeltaPhase[i + k - ( mlen - 1 )];
}
temp = 0;
for ( k = mlen - 1; k > 0; k-- )
for ( j = mlen - 1; j > 0; j-- )
if ( temparray[j-1] > temparray[j] )
temp = temparray[j-1];
temparray[j-1] = temparray[j];
temparray[j] = temp;
}
}
}
MedianDelta[i] = temparray[mlen - 1 - ( mlen / 2 )];
if ( MedianDelta[i] == 0 )
DC[i] = 15;
else
DC[i] = 6.28318 / MedianDelta[i] + .5;
InstPeriod[i] = .33 * DC[i] + .67 * InstPeriod[i-1];
Period[i] = .15 * InstPeriod[i] + .85 * Period[i-1];
Alpha1[i] = 2 / ( Period[i] + 1 );
AdaptCycle[i] = ( 1 - 0.5 * Alpha1[i] ) * ( 1 - 0.5 * Alpha1[i] ) * (
SmoothX[i] - 2 * SmoothX[i-1] + SmoothX[i-2] ) + 2 * ( 1 - Alpha1[i] ) *
AdaptCycle[i-1] - ( 1 - Alpha1[i] ) * ( 1 - Alpha1[i] ) * AdaptCycle[i-2];
}
Trigger = Ref( AdaptCycle, -1 );
BullSig = IIf( Cross( AdaptCycle, Trigger ), True, False );
BearSig = IIf( Cross( Trigger, AdaptCycle ), True, False );
Plot( AdaptCycle, "AdaptCycle", colorLightBlue );
Plot( Trigger , "Trigger", colorRed );
Plot( 0 , "", colorWhite, styleDashed );
if ( Arrows )
PlotShapes( shapeUpArrow*BullSig, colorBrightGreen );
PlotShapes( shapeDownArrow*BearSig, colorRed );
}
-
17-09-2012 08:23 AM #18
Member- Ngày tham gia
- Oct 2003
- Bài viết
- 365
- Được cám ơn 215 lần trong 148 bài gởi
Những series bài hay về phần mềm PTKT phân tích kỹ thuật AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: % B of Bollinger Bands With Adaptive Zones
Author/Uploader: Anthony Faragasso - ajf1111 [at] epix.net
Date/Time added: 2001-12-20 14:22:02
Origin:
Keywords:
Level: basic
Flags: indicator
Formula:
/* %B of Bollinger Bands With Adaptive Zones */
/* Gives Percentage of where the close is in relation to the bands.*/
/* High reading ( Upper band ) , Low reading (Lower band )
/* AFL code by Anthony Faragasso*/
//Inputs
Lookback=60;
Baseline=50;/*Do not Change*/
PerCent=95;
Pds =14;
b=( ( C+2 * StDev( C,20 ) - MA( C,20 ) ) / ( 4 * StDev( C,20 ) ) ) * 100;
/*Input */
Osc=b;
/*Value of Osc*/
Value1 = Osc;
/*Highest AND Lowest Values of Osc during Lookback Period*/
Value2 = HHV(Value1,Lookback);
Value3 = LLV(Value1,Lookback);
/*Range of Osc during Lookback Period*/
Value4 = Value2 - Value3;
/*Define PerCent of Range to determine OB AND OS levels*/
Value5 = Value4 * (PerCent / 100);
/*Calculate OB AND OS levels*/
Value6 = Value3 + Value5;
Value7 = Value2 - Value5;
baseline=IIf( Osc < 100 ,50 ,IIf( Osc < 0 ,0,0));
Plot(Baseline," Baseline",7,1+4); /* yellow*/
Plot(Value1,"( Adaptive Zones OSC )",6,1+4); /*BLUE*/
Plot(Value6,"O/B",4,1+4); /*RED -TOP(SELL)*/
Plot(Value7,"O/S",5,1+4); /*GREEN-BOT(BUY)*/
Plot(b,"( % B )" ,4,1);
-
Những thành viên sau đã cám ơn :
tradingpro8x (12-08-2013)
-
28-01-2015 08:56 AM #19
Gold Member- Ngày tham gia
- Oct 2009
- Bài viết
- 1,925
- Được cám ơn 617 lần trong 428 bài gởi
Phân tích kỹ thuật PTKT chứng khoán bằng AmiBroker
Giới thiệu các bác chỉ báo mới trong phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: Adaptive Laguerre Filter, from John Ehlers
Author/Uploader: Mich -
Date/Time added: 2006-12-01 14:19:58
Origin:
Keywords:
Level: basic
Flags: indicator,function
DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas. If you believe that formula has an error - contact the AUTHOR directly, not us. If you believe that you have copyright on that work (i.e. you have written this particular code yourself) please send us proper DMCA takedown notice. Please note that mathematical ideas/concepts can not be copyrighted, only actual AFL code if you wrote it yourself.
Description:
Laguerre Filtering, in its adaptive version (alpha is automaticaly adapted depending the error of filtering).
Can be apply to RSI or any other datas like the another Laguerre version on that AFL library :
http://www.amibroker.com/library/detail.php?id=450
To do :
- Kautz Filter, they are generic name for Laguerre Filter and treats complex signals (use amplitude and phase)
Formula:
//
---------------------------------------------------------------------------------------------------------------
//
//
// Adaptive Laguerre Filter, from John Ehlers
// Link :
http://www.mesasoftware.com/Papers/T...e%20Travel.exe
// Another works from Ehlers : http://www.mesasoftware.com/technicalpapers.htm
//
// Description :
// Laguerre Filtering, in its adaptive Version (alpha is automaticaly adapted
depending the error of filtering).
// Can be apply to RSI OR any other datas like the another Laguerre Version on
that AFL library :
// http://www.amibroker.com/library/detail.php?id=450
// To do :
// - Kautz Filter, they are generic Name for Laguerre Filter AND treats complex
signals (use amplitude AND phase)
//
// Coding author: Mich.
//
//
---------------------------------------------------------------------------------------------------------------
//
function ALFilter(price, length, medianlong) **
result=price;
L0 = price;
L1 = price;
L2 = price;
L3 = price;
coef=0.5;
Diff=0;
HH=0.1;
LL=0;
alpha=0.5;
for(i = 1+length; i < BarCount; i++) **
Diff[i] = abs(price[i] - result[i-1]);
HH[i] = Diff[i];
LL[i] = Diff[i];
for(j = 0; j < (length-1); j++) **
if (Diff[i-j] > HH[i]) HH[i] = Diff[i-j];
if (Diff[i-j] < LL[i]) LL[i] = Diff[i-j];
}
if ( (i > length) AND (HH[i] - LL[i] != 0) ) **
// SLOW :
//coef = Median(((Diff - LL) / (HH - LL)), 5);
// FAST :
//----- Speed up the median calculation by placing it inline : Thanks to its
author "Not Too Swift"
coeftemp=(Diff - LL) / (HH - LL);
mlen = medianlong;
for(k = mlen - 1; k >= 0; k--) temparray[k] = coeftemp[i + k - (mlen - 1)];
temp=0;
for(k = mlen - 1; k > 0; k--) **
for (j = mlen - 1; j > 0; j--) **
if (temparray[j-1] > temparray[j]) **
temp = temparray[j-1];
temparray[j-1] = temparray[j];
temparray[j] = temp;
}
}
}
coef[i] = temparray[(mlen/2)-0.5];
//----- End median calculation
} // end main IF
alpha=coef[i];
L0[i] = alpha*price[i] + (1 - alpha)*L0[i-1];
L1[i] = -(1 - alpha)*L0[i] + L0[i-1] + (1 - alpha)*L1[i-1];
L2[i] = -(1 - alpha)*L1[i] + L1[i-1] + (1 - alpha)*L2[i-1];
L3[i] = -(1 - alpha)*L2[i] + L2[i-1] + (1 - alpha)*L3[i-1];
result[i] = (L0[i] + 2*L1[i] + 2*L2[i] + L3[i]) / 6;
} // end main FOR
return result;
}
/* DEMO */
SetBarsRequired(2000,2000);
P = ParamField("Price field",-1);
periods = Param( "Periods", 20, 1, 40, 1 );
periodsmedian = Param( "Periods Median", 5, 1, 40, 1 );
Plot( ALFilter(P,periods,periodsmedian), "Adaptive Laguerre Filter", ParamColor(
"Adaptive Laguerre Filter", colorCycle ), ParamStyle("Style") );
-
17-09-2012 04:32 PM #20
Member- Ngày tham gia
- Oct 2003
- Bài viết
- 365
- Được cám ơn 215 lần trong 148 bài gởi
Những series bài hay về phần mềm PTKT phân tích kỹ thuật AmiBroker
Đây là loạt bài AmiBroker AFL Library về phần mềm phân tích kỹ thuật PTKT AmiBroker
Details:
Formula name: %b indicator - related bollinger bands
Author/Uploader: ajay - (email hidden)
Date/Time added: 2007-03-30 09:10:11
Origin:
Keywords: %b
Level: medium
Flags: indicator
Formula:
Graph0 = (Close - BBandBot (Close, 20, 2))
/ ((BBandTop (Close, 20, 2) - BBandBot (Close, 20, 2)));
Plot( Graph0, "%b indicator", colorBlue );
-
Những thành viên sau đã cám ơn :
tradingpro8x (12-08-2013)
Thông tin của chủ đề
Users Browsing this Thread
Có 4 thành viên đang xem chủ đề này. (0 thành viên và 4 khách vãng lai)
Similar Threads
-
Một bài phân tích hay, có lý và khách quan
By Brainstorm in forum Thảo luận Tình hìnhTrả lời: 0Bài viết cuối: 17-06-2012, 11:41 PM -
Phần mềm phân tích kỹ thuật
By waterloo1815 in forum CLB Chứng khoánTrả lời: 2Bài viết cuối: 28-10-2009, 11:32 PM
Bookmarks