Bollinger Bands Coding

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11955 quote
    smurfysmurfy
    Participant
    Junior

    Hi all,

    just want to check how do I get the Middle Line for BB?

    BBPERIOD = 20
    
    STDDEV = 2
    
    AVG = Average[BBPERIOD](close)
    BBUPPER = AVG + (Std[BBPERIOD] * STDDEV) // Upper Bollinger Value
    BBLOWER = AVG - (Std[BBPERIOD] * STDDEV) // Lower Bollinger Value

     

     

    I tried to calculate but the value I getting is so much different from the one on the Chart.

    Understanding that IG uses 10.2 PRT (WTH!!! already called them to upgrade), but is there a way now for me to Test my coding results to see what is the value calculated so that I can match what I see on the Chart?

    Thanks all!

    #11956 quote
    NicolasNicolas
    Keymaster
    Legend

    Hi, bollinger bands center line is a “simple moving average” of 20 periods, as you already calculated it with your AVG variable.

    #11958 quote
    smurfysmurfy
    Participant
    Junior

    Hi Nicolas,

    Great, thanks for your reply. Do you think using BB, RSI and MACD can identify Breakouts and take some profits from there?

    Also, I keep thinking on a scenario on how to code it.

    For example, if this strategy identifies a breakout, and enter a position to either buy/sell along with the breakout:

    Q: how do I determine the Take Profits portion? Well Stop Loss can be my previous bar highest or lowest for the time being and later can add in some risk management portion.

    Q: how do I “tell” my Bot not to repeat the same trend again as I already took profits. Maybe the trend is still there, but I already exit with some profits….

    Thanks!

    #11969 quote
    NicolasNicolas
    Keymaster
    Legend

    About the take profit, you should focus on keeping the best risk/reward ration the market can offer. In my own experience, I encourage you to cut quickly your loss and let your profit running.

    For your second question, it depends mainly on how the conditions for your strategy to initiate a trade are met.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Bollinger Bands Coding


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
smurfy @smurfy Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by NicolasNicolas
10 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/20/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...