![]() |
Linear Regression Moving Average |
Post Reply ![]() |
Page <12 |
Author | |
blackdog ![]() Regular ![]() ![]() Joined: 14 Nov 2006 Location: Vatican City State Posts: 43 |
![]() ![]() ![]() ![]() |
Maximo, a couple of comments on your detailed script:
I have a modified version of my script which I think fixes the gap problem. It is not as detailed as Maximo's script, I only am showing the changing of the colour on the indicator. It is somewhat similar to maximo's script in that it sets the indicator to one colour then overwrites parts of it with the second colour. linecolor:= if (ma3<hist(ma3,1),0, {for ma3 downdard}if (ma3>hist(ma3,1),1, {for ma3 upward}prev )); {for ma3 sideways}[drawundefined =gap] {This attribute is essential to prevent straight lines being drawn when indicator is "undefined"}[ color=red]ma3; {default colour for indicator when it is not green} [color=green]if (linecolor=1,ma3,undefined); {this leaves a gap on first bar upward but leaves last bar on graph filled}if (hist(linecolor,-1)=1,ma3,undefined); {this fills first gap upwards but leaves a gap on last bar of graph} { Between them these two lines of script cover all the required green area. Dont combine them into one compound if statement as it then fails to work on the last bar plotted} |
|
![]() |
|
maximo ![]() BullCharts Guru ![]() ![]() Joined: 02 Sep 2006 Location: Australia Posts: 232 |
![]() ![]() ![]() ![]() |
Thanks blackdog! Used your script and managed to remove the gap :) [target =price]ma3:= ma(C,30,E);linecolor:= if(ma3<hist(ma3,1),0,if(ma3>hist(ma3,1),1,prev));{no lines drawn when indicator is "undefined"} [drawundefined =gap][color=red] if (linecolor=0,hist(ma3,1),ma3);[color =green]if (linecolor=1,ma3,undefined)
|
|
![]() |
|
maximo ![]() BullCharts Guru ![]() ![]() Joined: 02 Sep 2006 Location: Australia Posts: 232 |
![]() ![]() ![]() ![]() |
Shows there's more than 1 way to skin a cat. Didn't know about [drawundefined=gap] and cant find it in the bullscript help. Cheers! |
|
![]() |
|
blackdog ![]() Regular ![]() ![]() Joined: 14 Nov 2006 Location: Vatican City State Posts: 43 |
![]() ![]() ![]() ![]() |
[drawundefined=gap] is not in bullscript help. I found it used in darvos box script and a little experimentation showed what it does... As you say, more than one way to skin a cat... hehe...
merry Christmas...
|
|
![]() |
|
Rounders ![]() Newbie ![]() Joined: 27 Jul 2008 Location: Portugal Posts: 1 |
![]() ![]() ![]() ![]() |
Hello I question that formula its for CMC Markets?? I can put that formula five me error why??? Tell something have fantastics trades
|
|
![]() |
|
maximo ![]() BullCharts Guru ![]() ![]() Joined: 02 Sep 2006 Location: Australia Posts: 232 |
![]() ![]() ![]() ![]() |
No Rounders it's for BullCharts software. CMC already has them built in. Backtest before trading. |
|
![]() |
Post Reply ![]() |
Page <12 |
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |