Multicharts Code - Outside Bollinger Bands - MultiCharts | futures io social day trading
futures io futures trading


Multicharts Code - Outside Bollinger Bands
Updated: Views / Replies:600 / 7
Created: by venatrix Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Multicharts Code - Outside Bollinger Bands

  #1 (permalink)
Elite Member
Aschaffenburg
 
Futures Experience: Beginner
Platform: NinjaTrader, Multicharts
Favorite Futures: ES
 
Posts: 15 since Feb 2012
Thanks: 4 given, 1 received

Multicharts Code - Outside Bollinger Bands

Hello,

I am having a problem with my Multicharts Code, maybe somebody can give me advice please.

The "Squeeze" is working, but I would like to print a "!" over the bar, when the price closes 2 times over/under
the upper/lower Bollinger Band.

I created the Input "OutOfBands ( 2 )" and some variables, but I don´t see the "!" on the chart.

Here is my Code:

 
Code
{
November 2015
BBSqueeze Indicator
}

inputs:
BollingerPrice	( close),
Length			( 10 ),
NumDevsUp		( 1 ),
NumDevsDn		( -1 ),
NumBars		( 90 ),
OutOfBands		( 2 ),
SqueezeColor		( Yellow ),
TextSize		( 16 );

Variables:
Av			( 0 ),
SDev			( 0 ),
LowerBand		( 0 ),
UpperBand		( 0 ),
FixBollPrice		( 0 ),
Diff			( 0 ),
OutUpBand		( 0 ),
OutDnBand		( 0 ),
SignalUpBand		( 0 ),
SignalDnBand		( 0 ),
VertTxtP1 		( 2 ), // 0 - below the specified price value 
				// 1 - above the specified price value
				// 2 - centered on the specified price value
HorizTxtP1 		( 2 ), // 0 - to the right of the specified bar
				 // 1 - to the left of the specified bar
				 // 2 - centered on the specified bar
HiTxt 			(-1),
LoTxt 			(-1);
		
Av =  AverageFC ( Bollingerprice, Length );
SDev = StandardDev ( BollingerPrice, Length, 1 );
UpperBand = Av + NumDevsUp * SDev;
LowerBand = Av + NumDevsDn * SDev;
Diff = UpperBand - LowerBand;

if Close > UpperBand then
	OutUpBand = OutUpBand +1
	else
	OutUpBand = 0;
if close < LowerBand then
	OutDnBand = OutDnBand +1
	else
	OutDnBand = 0;
	
if OutUpBand = OutOfBands then
	HiTxt = text_new(date,time,high +1 ,"!");
	text_setcolor(HiTxt,white);
	text_setsize(HiTxt,TextSize);
	text_setstyle(HiTxt, HorizTxtP1,VertTxtP1); 

if OutDnBand = OutOfBands then
	LoTxt = text_new(date,time,high +1 ,"!");
	text_setcolor(LoTxt,white);
	text_setsize(LoTxt,TextSize);
	text_setstyle(LoTxt, HorizTxtP1,VertTxtP1); 

Plot1 ( UpperBand, "Upperband");
Plot2 ( LowerBand, "Lowerband");
Plot3 ( Av, "Av");

If Diff <= Lowest ( Diff, NumBars ) then
begin
	SetPlotColor ( 1, Squeezecolor );
	SetPlotWidth ( 1, 3);
	SetPlotColor ( 2, Squeezecolor );
	SetPlotWidth ( 2, 3);
	Alert (Getsymbolname + "Squeeze" );
End;
Any idea what is wrong or missing?

Thank you.

Best regards,
Tim

Reply With Quote
 
  #2 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

Hi Tim,

I just tested your code and I get quite a lot "!" symbols on a 5 min @ES#. There are two potential issues that I can think of at the moment: 1. you are using a symbol where 1 point represents a large move (like a Forex symbol for example). 2. Your background color for the chart happens to be white which would be the same color as the exclamation marks.

When you right click on the chart and go to "Format Drawings" you should see several text objects in the list.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #3 (permalink)
Elite Member
Aschaffenburg
 
Futures Experience: Beginner
Platform: NinjaTrader, Multicharts
Favorite Futures: ES
 
Posts: 15 since Feb 2012
Thanks: 4 given, 1 received


Hi ABCTG,

thank you, the white color was the problem! Sometimes it is so easy....

I have found another Problem. When I plot the Bollinger Bands with my Indicator and add another Bollinger Band
Indicator from Multicharts I have 2 different plots in the Chart window. But in the Data Window I have the same correct numbers.

Whats wrong here?

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Thanks.

Best regards,
Tim

Reply With Quote
 
  #4 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

Tim,

that's most likely a scaling issue. When you check the Scaling tab under Format Study for each indicator both should be set to "Same as Instrument".

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #5 (permalink)
Elite Member
Aschaffenburg
 
Futures Experience: Beginner
Platform: NinjaTrader, Multicharts
Favorite Futures: ES
 
Posts: 15 since Feb 2012
Thanks: 4 given, 1 received

Hi ABCTG,

thank you very much, that is the solution!

Best regards,
Tim

Reply With Quote
 
  #6 (permalink)
Elite Member
Aschaffenburg
 
Futures Experience: Beginner
Platform: NinjaTrader, Multicharts
Favorite Futures: ES
 
Posts: 15 since Feb 2012
Thanks: 4 given, 1 received

Good morning ABCTG,

I tried over the weekend to change my code, but unfortunately I don't found a solution.

I plot "!" on the chart when the variable OutUpBand = OutOfBands:


 
Code
if OutUpBand = OutOfBands then
	HiTxt = text_new(date,time,high +1 ,"!");
	text_setcolor(HiTxt,white);
	text_setsize(HiTxt,TextSize);
	text_setstyle(HiTxt, HorizTxtP1,VertTxtP1);
Now I would like to print instead the "!" the value of the variable "OutUpBand".

Is this possible? How can I realize that?

Thank you.

Best regards,
Tim

Reply With Quote
 
  #7 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

Hi Tim,

you need to convert a numerical variable to a string using the reserved word NumToStr. Then you can draw this string on the chart.

 
Code
if OutUpBand = OutOfBands then
begin //using the begin here to include all text related reserved words in the check
	HiTxt = text_new(date,time,high +1 , NumToStr( OutUpBand, 0 ) ) ;
	text_setcolor(HiTxt,white);
	text_setsize(HiTxt,TextSize);
	text_setstyle(HiTxt, HorizTxtP1,VertTxtP1); 
end ;
Regards,

ABCTG


venatrix View Post
Good morning ABCTG,

I tried over the weekend to change my code, but unfortunately I don't found a solution.

I plot "!" on the chart when the variable OutUpBand = OutOfBands:


 
Code
if OutUpBand = OutOfBands then
	HiTxt = text_new(date,time,high +1 ,"!");
	text_setcolor(HiTxt,white);
	text_setsize(HiTxt,TextSize);
	text_setstyle(HiTxt, HorizTxtP1,VertTxtP1);
Now I would like to print instead the "!" the value of the variable "OutUpBand".

Is this possible? How can I realize that?

Thank you.

Best regards,
Tim


Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #8 (permalink)
Elite Member
Aschaffenburg
 
Futures Experience: Beginner
Platform: NinjaTrader, Multicharts
Favorite Futures: ES
 
Posts: 15 since Feb 2012
Thanks: 4 given, 1 received

Hello ABCTG,

thank you so much for your help! That looks great now!


Best regards,
Tim

Reply With Quote

Reply



futures io > > > > Multicharts Code - Outside Bollinger Bands

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bollinger Bands with Color JasonX NinjaTrader 15 April 29th, 2016 03:57 AM
modifying bollinger bands r68cervera NinjaTrader Programming 11 January 28th, 2015 11:01 AM
Bollinger Bands about EMA DMC123 NinjaTrader 1 July 11th, 2013 04:18 PM
Price Action with Bollinger Bands Saroj The Elite Circle 36 March 18th, 2012 08:12 AM
Bollinger Bands MWinfrey Traders Hideout 8 February 8th, 2011 08:02 AM


All times are GMT -4. The time now is 08:47 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-16 in 0.12 seconds with 19 queries on phoenix via your IP 54.160.245.121