Go Back   Traders Laboratory > Trading Resources > Trading Indicators > Coding Forum

Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Bookmarks
del.icio.us StumbleUpon Google Digg Facebook Furl Reddit Netscape

 
LinkBack Thread Tools Display Modes Language
  #11 (permalink)  
Old 03-26-2008, 07:50 PM
Blu-Ray's Avatar
Blu-Ray Blu-Ray is offline
Premium Trader

Trader Specs
 
Join Date: Nov 2006
Location: England
Posts: 355
Thanks: 60
Thanked 19 Times in 14 Posts
Re: Trend Indicator for TS?

Quote:
View Post
Well, thanks, but I think everyone here is getting a bit sidetracked by trying to determine what is or isn't a trend. Really, the only definition I'm interested in is the one I defined -- 4 full points on the ES in one direction (doesn't matter which) without a 6 tick retracement in the midst of that trend. That's not something I made up -- the system I'm trading has a higher probability of working by not trading a reversal of such a trend. I don't expect there to be anything with those exact parameters, of course. I was just hoping there might maybe be a code in which I could just plug in those numbers. For all I know, it's a ridiculous question. I'm still fairly new to trading, and even newer to TradeStation (I had used Sierra Chart before). Furthermore, I know NOTHING about coding! The only reason I think it might NOT be a ridiculous question is that I've already found myself amazed at what's out there, and what's possible even if not yet out there. Hope that clears things up! Thanks again.
J-S

Thrunner has posted some excellent material for you, but you seem to have dismissed it. I don't mind coding something up for you, but what you're describing without a pic doesn't make sense, as you can see in my chart below all 4 point moves are not equal.



Now seriously, I've asked 3 times for you to post a chart, but nothing yet, you keep saying just a 4 point move without a 6 tick retracement.

Heres the code you're after but it's missing a vital part:

Inputs:
UpColor( Green ),DownColor ( Red);

Condition1 = UpTrend { this being your version of an uptrend, eg 3 higher highs or 3 higher closes, or 3 closes above a moving average, above ATR.....etc }
Condition2 = DownTrend { Opposite criteria for uptrend }

If Condition1 then Plot1(high,"UpTrend", UpColor);
If Condition2 then Plot2(Low,"DownTrend", DownColor);

Cheers

Blu-Ray
Attached Images
File Type: png 4pointmoves.png (35.4 KB, 75 views)

__________________
Remember - Take the path of least resistance.
Reply With Quote
The Following User Says Thank You to Blu-Ray For This Useful Post:
J-S (03-26-2008)
  #12 (permalink)  
Old 03-26-2008, 10:30 PM
J-S J-S is offline
Registered Trader

 
Join Date: Mar 2008
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Trend Indicator for TS?

Blu Ray,

First, just a few comments. Believe me, I NEVER expected you or anyone else here to actually code anything for me! I just thought that someone might know of something in the universe of TS codes out there that might fit the description of what I'm looking for. I'm TRULY grateful! I wish you would have made that clear, though. The fact is, I've never (believe it or not) taken a screenshot of TS before. At first it wasn't uploading to this forum properly. Finally I tried saving the image as a jpeg instead of a bitmap file and now it seems to have worked. I just thought that a good description would be as good as an image, but I guess you feel otherwise. But again, had I known that you were actually going to attempt to code something, I would have acted differently.

Also, I have no doubt that Thrunner's information is, yes, excellent, and it wasn't my intention to dismiss it. It's just that I try to trade (like, I would think, most serious traders) very rule-based, and this definition of a trend fits my rules. I'm not saying that others aren't valid -- they're just not mine. Please keep in mind that what I'm trying to do here, in labeling these trends, is to disqualify potential trades without having to take the time to actually "count" the trend -- obviously very hard to do in a fast-moving market.

Anyway, the good news is that I found a perfect pic for you! As you'll see from my annotations on the actual chart, the upmove on the left does NOT constitute a trend according to my rules because the six-tick retracement prevents it from being one. The downmove on the right IS a trend, as there is no six-tick retracement. By the way, you'll notice that my bars are of a much shorter timeframe (well, volume level, actually) than the ones in your image. I suppose it doesn't really make a difference in the actual calculation, but it's certainly clearer visually when there are more bars involved. Maybe that's part of the confusion here. So, finally, here's the chart! Thanks again.
Attached Images
File Type: jpg TrendPic.jpg (72.6 KB, 34 views)

Reply With Quote
  #13 (permalink)  
Old 03-27-2008, 06:17 AM
Blu-Ray's Avatar
Blu-Ray Blu-Ray is offline
Premium Trader

Trader Specs
 
Join Date: Nov 2006
Location: England
Posts: 355
Thanks: 60
Thanked 19 Times in 14 Posts
Re: Trend Indicator for TS?

Thanks for the chart J-S.

The reason I asked for a chart is, as we all know, you can look at a chart and say " it's in an uptrend", but putting that into coding language is not so straight forward. Let me explain using your chart.

You could go for, for example, 3 higher highs.........so the code would be

if H > H[1] and H > H[2] and H > H[3] then plot............

but using your chart it would stop where I've marked A.

Alternatively you could use the code so if the high is higher or equal to previous bar, this would get you above A, but it would also signal an uptrend at B for example.

You could then move on to higher highs and higher lows and this would again stop at A.

You could then do as above so the high and low are greater or equals to the previous, but realise that could result in C.

Another thing that you might ( edit: you will ) find is that where I've marked D. for example if that low was 1 tick above the previous low then your downtrend is invalidated ( via the code ) but you're still clearly in a downtrend.

Basically what I'm trying to point out is that although visually we can spot a trend, but putting that into code needs criteria.

Hope this helps

Blu-Ray

Attached Images
File Type: png JS_Chart.png (260.5 KB, 77 views)

__________________
Remember - Take the path of least resistance.
Reply With Quote
  #14 (permalink)  
Old 03-27-2008, 07:53 AM
BlowFish's Avatar
BlowFish BlowFish is offline
Dullard

Trader Specs
 
Join Date: Mar 2007
Location: Europe Mostly
Posts: 615
Thanks: 20
Thanked 58 Times in 45 Posts
Re: Trend Indicator for TS?

J-S on your chart the downtrend is over almost as soon as it starts. You don't know it is a downtrend until it has moved 4 points right? A point later price retraces 6+ ticks so its finished.

There are much better ways of determining trend imho that you can see instantly just using price action. Is price making higher highs higher lows and higher closes? Is it leaving higher swing highs and swing lows? etc. Thats just my opinion each to there own of course

You might want to check out Clyde Lee's website the swing machine he has a tradestation function called swingleeII (from memory) that is freely given and has many user inputs and options to determine swing points. It will plot a zigzag swing to swing I think too. Actually i believe most zigzag indicators will do what you require with little or no modification.

Cheers.

Reply With Quote
  #15 (permalink)  
Old 03-27-2008, 10:15 AM
J-S J-S is offline
Registered Trader

 
Join Date: Mar 2008
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Trend Indicator for TS?

Okay, this is obviously more difficult than I thought. Or, maybe I should say, than I had hoped! I'm going to have to take some time to digest all of this after-hours. I'm kind of getting the feeling that what I want is not possible -- indefinable by code.

Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Heikin Ashi Trend Indicator Soultrader Trading Indicators 25 02-21-2008 06:24 PM
Objective ways to define a trend day before the trend has run its course?? Adamned Technical Analysis 7 01-29-2008 09:06 AM
REQ Help with Trend Indicator jjthetrader Coding Forum 55 12-14-2007 05:33 PM
Trend lines on an indicator zardoz Technical Analysis 1 05-16-2007 12:59 PM
Volume Gradient + Heikin Ashii Trend Indicator GCB Trading Indicators 27 04-07-2007 08:29 AM


All times are GMT -4. The time now is 12:50 PM.

 


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58