DailyFX Home | Español | Français | 中文 | Deutsch | Italiano | العربية | Sverige | Ελληνικά


+ Reply to Thread
Page 1 of 6 1 2 3 4 5 ... LastLast
Results 1 to 15 of 85
Like Tree1Likes

Thread: INDICATOR ENTRY/EXIT - Bollinger Band with Moving Average 2-line Crossover Filter

  1. #1
    David Rodriguez's Avatar
    David Rodriguez is offline Moderator David Rodriguez is an unknown quantity at this time
    Join Date
    Jan 2007
    Posts
    725

    INDICATOR ENTRY/EXIT - Bollinger Band with Moving Average 2-line Crossover Filter

    Forex Bollinger Band Reversal Strategy with Trend filter

    Entry Rule: Wait until price falls below the lower Bollinger band or above the upper band. When price subsequently crosses back above the lower band and closes there, place a buy stop entry order at the last value for the lower band. When price crosses back below the upper band, place a sell stop entry order at the last value for the upper band.

    Filter: If "fastlength" and "medlength" inputs are used, strategy may only go long if the "fastlength"-period Simple Moving Average is above the "mediumlength". It may only go short if the opposite is true. "fastlength" and "medlength" are set to 0 by default, which leaves them off. Changing these to non-zero values activates the use of the filter in this Strategy Advisor.

    Stop Loss: None by default. It may be entered using "StopLoss" input.

    Take Profit: None by default. It may be entered using "ProfitTarget" input.

    Exit Rule: The trade is taken out by the opposite signal. Thus if we are long due a cross above the lower band, a cross below the upper band would close the existing long position and establish a short position. The reverse is also true.

    Directions: Download the attached .zip file. Go to the directory under which you've unzipped the contents of the file. Open the "BollingerMAFilter.fxd" file and when prompted by the Strategy Language Editor, hit "OK" to import the file. Once you have imported the Strategy Advisor, open the "BollingerMAFilter.fxw" file included in the attached zip to see examples on how you may use this in your charts.

    This is an example Strategy Advisor provided for educational purposes only. This has not been coded as a standalone strategy for live trading and is for illustrative purposes only. Though the author has done his best to ensure accuracy and that said code is built to specifications, there is no implicit or explicit guarantee that this code is correct. Past performance is absolutely not a guarantee of future results, and many strategies are built with the benefit of hindsight.
    Attached Files
    Last edited by Lucas Izidoro; 11-24-2010 at 09:17 AM.
    David Rodriguez is the author of Forex Trading Signals and Forex Trading Weekly Forecast on DailyFX.com.

  2. #2
    Shr1k is offline Member Shr1k is on a distinguished road
    Join Date
    Feb 2009
    Posts
    24
    Thanks this is just the example I needed
    I have been trying to set up a very similar strat. I am sure this will help me in my quest to learn C#.

  3. #3
    fed_funds's Avatar
    fed_funds is offline Bronze Member fed_funds is an unknown quantity at this time
    Join Date
    Apr 2010
    Posts
    17

    Testing BollingerMAFilter

    Possible variant medium / long term..
    enjoy
    Attached Files

  4. #4
    David Rodriguez's Avatar
    David Rodriguez is offline Moderator David Rodriguez is an unknown quantity at this time
    Join Date
    Jan 2007
    Posts
    725
    Quote Originally Posted by Shr1k View Post
    Thanks this is just the example I needed
    I have been trying to set up a very similar strat. I am sure this will help me in my quest to learn C#.
    Thanks for the feedback. If you have questions on Strategy Trader-specific functions/classes be sure to post them on the forum and I'm sure our moderators and fellow forum members can help you out.
    David Rodriguez is the author of Forex Trading Signals and Forex Trading Weekly Forecast on DailyFX.com.

  5. #5
    David Rodriguez's Avatar
    David Rodriguez is offline Moderator David Rodriguez is an unknown quantity at this time
    Join Date
    Jan 2007
    Posts
    725
    Quote Originally Posted by fed_funds View Post
    Possible variant medium / long term..
    enjoy
    Nice backtest results for sure. For what it's worth, I realized after the fact that my transaction cost assumptions were a bit aggressive. Thus you could assume something like 3 pips and still have a fairly reasonable estimate of real-world transaction costs.
    David Rodriguez is the author of Forex Trading Signals and Forex Trading Weekly Forecast on DailyFX.com.

  6. #6
    not_now is offline Gold Member not_now is an unknown quantity at this time
    Join Date
    Jul 2010
    Posts
    192
    ...but why cost assumptions? The usual way is to backtest the strategy with bid/ask prices, which should approximate the different spread throughout the day, right?

  7. #7
    fed_funds's Avatar
    fed_funds is offline Bronze Member fed_funds is an unknown quantity at this time
    Join Date
    Apr 2010
    Posts
    17

    BollingerMAFilter possible variant

    Let me know comments & improvements.tnx
    Attached Files

  8. #8
    David Rodriguez's Avatar
    David Rodriguez is offline Moderator David Rodriguez is an unknown quantity at this time
    Join Date
    Jan 2007
    Posts
    725
    Quote Originally Posted by not_now View Post
    ...but why cost assumptions? The usual way is to backtest the strategy with bid/ask prices, which should approximate the different spread throughout the day, right?
    yes, but to save time when writing these article and researching these topics, I will run it only on bid data so as to run faster optimizations. I'm willing to allow for a minor loss in absolute accuracy for faster backtests, and frankly nothing ever substitutes live trading conditions. Thus I feel doing bid/ask backtests gives you a false sense of confidence in the backtest results.
    David Rodriguez is the author of Forex Trading Signals and Forex Trading Weekly Forecast on DailyFX.com.

  9. #9
    fed_funds's Avatar
    fed_funds is offline Bronze Member fed_funds is an unknown quantity at this time
    Join Date
    Apr 2010
    Posts
    17

    AUD/NZD possible application

    High volatility but interesting results over time.
    Attached Files

  10. #10
    not_now is offline Gold Member not_now is an unknown quantity at this time
    Join Date
    Jul 2010
    Posts
    192
    Quote Originally Posted by David Rodriguez View Post
    yes, but to save time when writing these article and researching these topics, I will run it only on bid data so as to run faster optimizations. I'm willing to allow for a minor loss in absolute accuracy for faster backtests, and frankly nothing ever substitutes live trading conditions. Thus I feel doing bid/ask backtests gives you a false sense of confidence in the backtest results.
    It would be equally wrong to ruin the backtest as much as possible in order not to have "false sense of security".

  11. #11
    perseidas is offline Gold Member perseidas is an unknown quantity at this time
    Join Date
    Jul 2010
    Posts
    33

    StopLoss discrepancy

    Quote Originally Posted by David Rodriguez View Post
    Forex Bollinger Band Reversal Strategy with Trend filter

    Stop Loss: None by default. It may be entered using "StopLoss" input.
    Hi David, thanks for sharing.

    I'm testing this strategy in EURUSD hourly. However, there's something going on with the StopLoss that I can't understand.

    This parameter refers to a pip cost divided by point value?!?

    I have point value = 10000$, and if I set StopLoss to 0.0001 I get complete different amounts of loss when closing with StopLoss.

  12. #12
    jdavis is offline FXCM Automated Platform Specialist jdavis is an unknown quantity at this time
    Join Date
    Jan 2010
    Posts
    818
    According to the code, stoploss is simply the literal price difference you're wanting to set the stop at. When the SL is generated the target price is calulated by subtracting that stoploss input value from the entry price. In your example, .0001 is going to throw a stoploss at 1 pip. In other words, it'll typically hit right after the order is placed. If you were using a yen pair, you'd want to set in terms of pips for yen, i.e. .01

    -jd
    API Team

  13. #13
    Croaker is offline Member Croaker is an unknown quantity at this time
    Join Date
    Oct 2010
    Posts
    6

    Issue

    Hello

    I'd like to ask for some help.
    I was talking with Anthony Park, he told me that maybe you could help me with this problem.

    If I go to 'Format Strategy Advisor' then 'Format', and I'm trying to enter a profit target or a stop loss like Anthony said ( .0005 for example) I have an error message :
    "Input string was not in a correct format"

    If I type 0,0005 it is ok, but I don't know how many pip does it means, if it means something valid at all.

    So please let me know how to enter the StopLoss and ProfitTarget.

    Thank you!
    Croaker

  14. #14
    samer1112 is offline Gold Member samer1112 is an unknown quantity at this time
    Join Date
    Mar 2009
    Posts
    28
    Quote Originally Posted by David Rodriguez View Post
    Exit Rule: The trade is taken out by the opposite signal. Thus if we are long due a cross above the lower band, a cross below the upper band would close the existing long position and establish a short position. The reverse is also tru
    could you modify this rule to be :

    exit rule : only with stop or limit is met , with only one position open ( if we were long due a cross above the lower band ,a cross below the upper band would not close the existing long position and would not establish a short position until the long position meted stop or limit , then the expert could take a new position due a crossing

    thanks

  15. #15
    jdavis is offline FXCM Automated Platform Specialist jdavis is an unknown quantity at this time
    Join Date
    Jan 2010
    Posts
    818
    Quote Originally Posted by Croaker View Post
    Hello

    I'd like to ask for some help.
    I was talking with Anthony Park, he told me that maybe you could help me with this problem.

    If I go to 'Format Strategy Advisor' then 'Format', and I'm trying to enter a profit target or a stop loss like Anthony said ( .0005 for example) I have an error message :
    "Input string was not in a correct format"

    If I type 0,0005 it is ok, but I don't know how many pip does it means, if it means something valid at all.

    So please let me know how to enter the StopLoss and ProfitTarget.

    Thank you!
    Croaker

    Having chatted with Anthony, it appears you have some internatinoal numbering system on your PC that's different from what the strategy was intended. It's strange, but if 0,0005 works for you, simply continue to use it where you would normally put in 0.0005. Run the strategy on a demo, and then check the trades and just verify that the strategy closes at it's intended price/pip distance.

    -jd
    API Team

+ Reply to Thread
Page 1 of 6 1 2 3 4 5 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Disclaimer: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. Forex Capital Markets LLC. will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information.