MQL4 - automated forex trading   /  

Code Base

Code Base  Indicators  Indicator for Stop Loss levels calculation using Bill Williams technique To post a new code, please log in or register

This library is for
MetaTrader 4
Download MT 4 - 5.5 Mb

Mobile trading!
Buy a license and be mobile in your trading!

Name:
Indicator for Stop Loss levels calculation using Bill Williams technique [ ru ]
Author: cmillion (2009.11.10 10:30)
Downloaded: 1991
Download:
 SL_to_Bar_ENG.mq4 (9.3 Kb) View
 SL_BW.mq4 (10.8 Kb) View

Author

Vladmir Hlystov

Description:

An indicator for Stop Loss levels calculation using Bill Willams technique

Bill Williams in his book "Trading Chaos: Applying Expert Techniques to Maximize Your Profits" (Chapter 7, Level One: Novice Trader, p.95) has described SL as follows:

"...We place the air bag one tick above/below the high/low of the second bar back on one significantly higher time frame (or the next bar further back that has both a higher high and a higher low or a lower high and lower low).

This is our air bag protection. Its purpose is to protect us against a drunken market that is moving against us. Remember, it is not necessiarly an entry signal; it is protection against major losses..."

The indicator calculates and shows Stop Loss levels (for Buy and Sell positions without installed SL) using this method.

Indicator variables:

int BAR = 200; // searching for in last BAR bar

int minSL = 25; // it is exposed when 2 bars are not found
bool show_bar = true; // show bars on which search for SL
show_info = true; // show active orders without SL
color color_BAR = DarkSlateGray; // colour bar on which search for SL
color color_Тек_BAR = Gray; // colour of the current bar
color color_SL = Gray; // colour of the marks

Image:


Fig 1. Bar was found



Fig 2. The upper bar was not found (SL for Sell position has determined using the greater timeframe):

Recommendations:

    • SL Level is drawing on the right side of the current bar, set chart shift on:
    • To make it clear, use show_bar=true
    • Good Luck!


    17.10.2009:

    A new feature has added:

    It is possible to show Stop Loss Levels in the history (SL_BW.mq4):



    4 comments  To post a new comment, please log in or register

    Write on cmillion@narod.ru, advisable in russian.

    19.02.2010 10:00 cmillion
    kimitrio wrote:

    Very Cool & Useful,i use it in my expert, Draw down now goes to 5% with this and profit is now better, thank you Cmillion,


    Hi, very nice, thank you. When I set the stop loss minimum to anything else but 25, it goes back to 25. Can you help?

    Thanks. Andre andre@koorts.com

    19.02.2010 09:23 akoorts

    Very Cool & Useful,i use it in my expert, Draw down now goes to 5% with this and profit is now better, thank you Cmillion,


    11.02.2010 01:46 kimitrio

    I shall write any adviser or robot, write more detailed that task in cmillion@narod.ru

    20.11.2009 10:49 cmillion