Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Donchian Bottom Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
arathod
Posted : Thursday, April 17, 2014 11:13:55 AM
Platinum Customer Platinum Customer

Joined: 10/20/2008
Posts: 357

How to make an indicator or condition that is true if the 

 

donchian bottom keeps rising or stays at the same level. It should be false if it moves down and stay down. Thank you. 

Bruce_L
Posted : Thursday, April 17, 2014 12:12:29 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Please try the following RealCode Condition. The DCTop and DCBottom lines were created by dragging and dropping the Donchian Channels into the Code tab of the RealCode Editor.

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Donchian Bottom
'|******************************************************************
'# DCTop = chart.DonchianChannels.0
'# DCBottom = chart.DonchianChannels.1
Static Direction As Integer
If isFirstBar Then
	Direction = 0
End If
If DCBottom.Value > DCBottom.Value(1) Then
	Direction = 1
Else If DCBottom.Value < DCBottom.Value(1) Then
	Direction = -1
End If
If Direction = 0 Then
	SetIndexInvalid
Else
	If Direction = 1 Then
		Pass
	End If
End If


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
arathod
Posted : Thursday, April 17, 2014 6:49:56 PM
Platinum Customer Platinum Customer

Joined: 10/20/2008
Posts: 357

Thanks Bruce. But it did not work for YNDX. The donch bottom started falling but the signal did not cease. Appreciate your help. Basically I want to buy when the donch bottom is rising.  (specifically, donch bottom of the ratio of price to sp-500). Thank you very much. 

arathod
Posted : Thursday, April 17, 2014 6:52:53 PM
Platinum Customer Platinum Customer

Joined: 10/20/2008
Posts: 357

Let me futher clarify. I think what is happening is that your code takes into account top donch also. But I want to focus on bottom donch only. Thank you. 

Bruce_L
Posted : Monday, April 21, 2014 10:47:51 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Using the default 15 period Donchain Channels applied to price history, the condition is most definitely working on my computer. The two most recent times it is true on a daily chart of YNDX are from December 3, 2013 through January 23, 2014 and February 26, 2014 and March 3, 2014.

The top Donchian Channel is not used at all in the calculations. It just shows up because that is what happens when you drag and drop the Donchian Channels into the RealCode?

Do you have more than one set of Donchian Channels plotted on the chart? Does the name of the Donchian Channels as imported into the RealCode match the Donchian Channels on the chart and are they still linked?



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
arathod
Posted : Tuesday, April 22, 2014 12:48:11 PM
Platinum Customer Platinum Customer

Joined: 10/20/2008
Posts: 357

Thanks. My bad. 

I have a request though. I tried to apply it to donch on a ratio or price history to price for symbol but did not work. Is there a way to make it work on a ratio please? Thank you. 

Bruce_L
Posted : Tuesday, April 22, 2014 2:52:26 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

It should work on any Donchian Channels. You just need to drag and drop those particular Donchian Channels into the RealCode to create the DCTop and DCBottom lines.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
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.