Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Creating a condition? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
sturner
Posted : Tuesday, March 10, 2015 11:54:44 AM
Registered User
Joined: 12/31/2004
Posts: 102

Hi, I have simply put a Donchian channel on the price history in the top panel and all I want to do is creat a "combination condition" marker from where price history has fallen below the lower Donchian and stays on until it rises back above the top Donchian.  I tried marking the two conditions (one for fall below and one for rise above) as the first step towards a combo condition and it doesn't appear to mark anything.  I then tried the "conditon" indicator on the default Stochastics (tested rising above 50) and it marked the date fine... so I'm confused as to why it's not marking the Donchian breaches... thoughts?

sturner
Posted : Tuesday, March 10, 2015 12:13:21 PM
Registered User
Joined: 12/31/2004
Posts: 102

Ok, so the more I look at it- I don't know if a "combo" condition would work since I'm not marking when BOTH conditions are present... I'm trying to mark the entire period from where price falls below the donchian to then back above it.  Make sense?

Bruce_L
Posted : Tuesday, March 10, 2015 1:07:25 PM


Worden Trainer

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

It reads like you want a condition for being below the Donchion Channel instead of creating conditions for crossing down through the Donchian Channel and crossing up through the Donchian Channel.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
sturner
Posted : Tuesday, March 10, 2015 1:51:32 PM
Registered User
Joined: 12/31/2004
Posts: 102

I want to mark the period of time between the sell signal and the next buy signal... where theDonchian breaches are the triggers

 

Bruce_L
Posted : Tuesday, March 10, 2015 2:51:30 PM


Worden Trainer

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

The # DCTop and # DCBottom lines of the following RealCode Condition were created by dragging and dropping the Donchian Channels into the Edit tab of a RealCode Condition.

Writing Conditions in RealCode (10:11)

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Donchian Example
'|******************************************************************
'# DCTop = chart.DonchianChannels.0
'# DCBottom = chart.DonchianChannels.1
'# Cumulative
Static Highlight As Boolean
If isFirstBar Then
	Highlight = False
End If
If Price.Last < DCBottom.Value Then
	Highlight = True
Else If Price.Last > DCTop.Value Then
	Highlight = False
End If
If Highlight = True Then
	Pass
End If


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
sturner
Posted : Tuesday, March 10, 2015 4:33:50 PM
Registered User
Joined: 12/31/2004
Posts: 102

So I have dumped that into the edit box of the RealCode "Add Conditon" feature... it shows up as an icon at the bottom of the chart, but it doesnt "mark" the chart like I wanted it to.   What would I be missing? 

Bruce_L
Posted : Tuesday, March 10, 2015 5:00:44 PM


Worden Trainer

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

Try dragging the condition onto the chart and selecting Draw Hash Marks.

You might also want to try checking for the low being below the bottom and the high being above the top (the previous checks for the close).

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Donchian Example
'|******************************************************************
'# DCTop = chart.DonchianChannels.0
'# DCBottom = chart.DonchianChannels.1
'# Cumulative
Static Highlight As Boolean
If isFirstBar Then
	Highlight = False
End If
If Price.Low < DCBottom.Value Then
	Highlight = True
Else If Price.High > DCTop.Value Then
	Highlight = False
End If
If Highlight = True Then
	Pass
End If


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
sturner
Posted : Tuesday, March 10, 2015 5:07:58 PM
Registered User
Joined: 12/31/2004
Posts: 102

it doesn't look like it is working... I wonder (as a result of the way Donchian's work with price) if I need to simply tell it "if the lower Donchian reverses down from the last bar, turn on sell signal... keep that sell signal on until upper Donchian reverses back up from prior bar"... know what I mean? as price won't stay below the Donchian like it would a moving avg... it only breaks and then the Donchian follows it lower. 

sturner
Posted : Wednesday, March 11, 2015 11:42:39 AM
Registered User
Joined: 12/31/2004
Posts: 102

I hope my question from last night made sense... my issue still remains that the code above looks to mark the ALL the points where price is BELOW the higher Donchian, whereas what I'm trying to do is have "sell signal" mark on the first time where price breaches the lower Donchian and a "buy" signal where price come back above the higher Donchian.  And in a perfect world, a paint bar scheme to mark the period between the sell and buy signal.  Is this clear? 

Thanks for the help!

Sam

 
sturner
Posted : Wednesday, March 11, 2015 11:51:44 AM
Registered User
Joined: 12/31/2004
Posts: 102

And again, because of the way Donchians work... I could also say "mark the first sell signal the first time the Donchian falls... and mark the buy signal the next time the Donchian rises... then paint the bars in between (the downtrend)"... make sense?

 

Bruce_L
Posted : Wednesday, March 11, 2015 3:00:10 PM


Worden Trainer

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

Your technique of checking for the bottom Donchian Channel going down will return true one bar after a condition for the low crossing down through the bottom Donchian Channel.

Your technique of checking for the top Donchian Channel going up will return true one bar after a condition for the high crossing up through the top Donchian Channel.

These conditions might work for the sell and buy, but would not work to return true for the bars between the sell and buy.

The RealCode in my Tuesday, March 10, 2015 5:00:44 PM ET post is for the point scheme. It points all of the points starting where price first drops through the bottom Donchian Channel through the bar before where price breaks up through the upper Donchian Channel. So it is marking from sell signal up until the buy signal.

If you just want the sell signal you can extract the following from the RealCode for between the two signals.

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Donchian Sell
'|******************************************************************
'# DCBottom = chart.DonchianChannels.1
'# Cumulative
If Price.Low(1) >= DCBottom.Value(1) AndAlso _
	Price.Low < DCBottom.Value Then
	Pass
End If

And if you just want the buy signal you can extract the following from the RealCode for between the two signals.

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Donchian Buy
'|******************************************************************
'# DCTop = chart.DonchianChannels.0
If Price.High(1) <= DCTop.Value(1) AndAlso _
	Price.High > DCTop.Value Then
	Pass
End If


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