indicator that "records" last signal  [SOLVED]

Questions about MultiCharts and user contributed studies.
lopper70
Posts: 22
Joined: 17 Oct 2014
Has thanked: 2 times

indicator that "records" last signal

Postby lopper70 » 28 Jul 2016

Hello (sorry my english)

it's possibile create this indicator?...

I create chart with DATA1 the 1 second chart line (or tick by tick, one contract, ecc...)
DATA2 with same instrument but 300 second chart

I want to create one strategy in the DATA2 chart, if it's true I want color DATA1 chart line

example:

I create Bollinger Band code for DATA2 chart and I want that when last price is above up bollinger band che line DATA1 chart is colored RED
when is under down bollinger band line DATA1 chart is colored GREEN

but not only this...if in the DATA2 chart is only up shadows to above up bollinger and close bar is under (then only the maximum of the candle is up)...in the line DATA1 chart, I still want to see colored RED the period that has been above

this example is for bollinger, but I can create it for so many indicators that I follow...is possibile to create it?

thank you

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: indicator that "records" last signal

Postby TJ » 28 Jul 2016

Hello (sorry my english)

it's possibile create this indicator?...

I create chart with DATA1 the 1 second chart line (or tick by tick, one contract, ecc...)
DATA2 with same instrument but 300 second chart

I want to create one strategy in the DATA2 chart, if it's true I want color DATA1 chart line

example:

I create Bollinger Band code for DATA2 chart and I want that when last price is above up bollinger band che line DATA1 chart is colored RED
when is under down bollinger band line DATA1 chart is colored GREEN

but not only this...if in the DATA2 chart is only up shadows to above up bollinger and close bar is under (then only the maximum of the candle is up)...in the line DATA1 chart, I still want to see colored RED the period that has been above

this example is for bollinger, but I can create it for so many indicators that I follow...is possibile to create it?

thank you

Yes it is possible.
Analysis -- That's what MultiCharts is designed to do.


If you are new to programming MultiCharts, you should start here.
viewtopic.php?f=16&t=6929

Pay attention to post #4 & #5

lopper70
Posts: 22
Joined: 17 Oct 2014
Has thanked: 2 times

Re: indicator that "records" last signal

Postby lopper70 » 30 Jul 2016

thanks, I managed to create this...

Code: Select all

inputs:
BollingerPrice( Close of data2 ),
TestPriceUBand( Close of data2),
TestPriceLBand( Close of data2 ),
Length( 20 ),
NumDevsUp( 2 ),
NumDevsDn( -2 ),
price (close of data1);

variables:
var0( 0 of data2 ),
var1( 0 of data2),
var2( 0 of data2),
var3( 0 of data2) ;

var0 = AverageFC( BollingerPrice, Length )of data2;
var1 = StandardDev( BollingerPrice, Length, 1 ) of data2;
var3 = (var0 + NumDevsUp * var1) of data2;
var2 = (var0 + NumDevsDn * var1) of data2 ;

if price > var2 and price < var3 then
PlotPB(High of data1, Low of data1, Open of data1, Close of data1, "Bar Normal", green );

if price > var3 then
PlotPB(High of data1, Low of data1, Open of data1, Close of data1, "Bar Normal", blue );


if price < var2 then
PlotPB(High of data1, Low of data1, Open of data1, Close of data1, "Bar Up", blue );
example YM chart, 1 second and 5 minutes...if have only the shadows under down bollinger, the 1 second chart it's colored blue...this was my purpose!

https://gyazo.com/4475ae55a58098dbc8079f382e149656

if you have to give me tips to improve my code, I'm happy :-)

Now I try it with other indicators code

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: indicator that "records" last signal  [SOLVED]

Postby TJ » 30 Jul 2016

thanks, I managed to create this...
::

if you have to give me tips to improve my code, I'm happy :-)

Now I try it with other indicators code

Good work.
Thanks for sharing.



Tips: see post #5
viewtopic.php?f=16&t=11713


Return to “MultiCharts”