Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 11-27-2009, 09:39 AM   #9

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Help Needed For Indicator

Did my suggestion not work? It should have done if the question was correctly expressed in your original post.

Once you trigger true nothing in your code ever resets back to false. Either always reset to false at the start of your code -or- have an else clause where you test your conditions. The former will just show the bar that transitions from false to true the latter will show all bars that meet the condition. Simple logic error.

Problem solved as far as I can see.
BlowFish is offline  
Reply With Quote
Old 11-27-2009, 10:08 AM   #10

mrtraderguy's Avatar

Join Date: Nov 2009
Location: Miami
Posts: 15
Ignore this user

Thanks: 1
Thanked 2 Times in 2 Posts



Re: Help Needed For Indicator

Quote:
Originally Posted by nab999 »
At Bar A either the fast or the slow average have a slope that is either down or level.

At Bar B the slope of both the fast and slow averages are up, so on this bar the show me plot would be made.

No further plots are made until a new bar A followed by a new bar B formation is made.
A) OK, so the setup (assuming TS 8.6) is a symbol with at least three data series:
[1]Symbol, [2] Slow Stochs, [3] Fast Stochs.
--> Note: I do expect the data series to be in the right place; I don't error check on this since I write stuff for myself and keep all my setups correct by hand :-)

B) So you're looking for divergence between data series [2] & [3] then, from what I read above.

C) The main condition is that both lines in [2] are flat or down and both lines in [3] are up.

D) Crossing of the lines is not relevant here; just [2] both flat/down and [3] up at the same time.

E) The processing of the conditions does not occur intra-bar, only on closed bars.

Is this correct? I'm rebuilding some code now that was lost during a BlueScreen this morning, so since most of this is the same as what I have, I'll post what I have later and you can use it if you want or can change it to whatever you need.

MTG
mrtraderguy is offline  
Reply With Quote
Old 11-27-2009, 10:34 AM   #11

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,589
Ignore this user

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Help Needed For Indicator

Quote:
Originally Posted by BlowFish »
Did my suggestion not work? It should have done if the question was correctly expressed in your original post.

Once you trigger true nothing in your code ever resets back to false. Either always reset to false at the start of your code -or- have an else clause where you test your conditions. The former will just show the bar that transitions from false to true the latter will show all bars that meet the condition. Simple logic error.

that's why I insist on people writing out their thoughts,
instead of jumping into coding immediately.


Quote:
Originally Posted by BlowFish »
Problem solved as far as I can see.

I really don't care if he solved the problem...
some people only want a quick fix. As far as I am concerned, the "problem" is not in the logic.
__________________


..........This is a terribly difficult question to answer. The only satisfactory answer is: "It depends"...
Tams is online now  
Reply With Quote
Old 11-27-2009, 10:59 AM   #12

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Help Needed For Indicator

Thats not what he said Mr T G, he simply wants a mark when two moving avergaes ( a fast and a slow) both turn up. Single data series, no stochs, no divergences, unless I mis read the original post and code.

this will probably do it though I have simply modified your original code so might not be the most elegant way of doing it.

Code:
inputs:
fastLength(5),
slowLength(10),
BEx(0.5);

Var:
longTrigger(false),
longTriggerValue(0),
fastValue(0),
slowValue(0);

longTrigger = false;
Value1=LOW ;

fastValue = Average( Close, fastLength );
slowValue = Average( Close, slowLength );

if fastvalue[1]<=fastvalue[2] or slowValue[1] <= slowValue[2] then {where previous MA's down?}
  If FastValue>FastValue[1] and slowvalue>slowvalue[1]               {if so check if current MA is up}
     and close>open then longTrigger = true;


if longTrigger=true then
begin
  longTriggerValue = High +( range * BEx );

  Plot1(Value1);
  Plot2(LongTriggerValue);
end;
Cant remember whether braces are EL comments or a MC extension might have to change those.
BlowFish is offline  
Reply With Quote
The Following User Says Thank You to BlowFish For This Useful Post:
nab999 (11-29-2009)
Old 11-27-2009, 11:04 AM   #13

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Help Needed For Indicator

Quote:
Originally Posted by Tams »
that's why I insist on people writing out their thoughts,
instead of jumping into coding immediately.

I really don't care if he solved the problem...
some people only want a quick fix. As far as I am concerned, the "problem" is not in the logic.
Actually that was why I tried to help compared t0o many posters he did a reasonable job of describing what he was trying to do . He posted some code that he had taken a stab at, reasonably clearly described what he was trying to do and posted a chart with an illustration of how it looked and how it should look. Compared to many of the "please help" posts a zillion miles ahead ! I think (though I may be mistaken) there was enough information in the original post to provide a solution. Time will tell I guess!

Having said that your advice was spot on for him finding the solution for himself.
BlowFish is offline  
Reply With Quote
Old 11-27-2009, 11:12 AM   #14

mrtraderguy's Avatar

Join Date: Nov 2009
Location: Miami
Posts: 15
Ignore this user

Thanks: 1
Thanked 2 Times in 2 Posts



Cool Re: Help Needed For Indicator

I agree with you both, (BFish/Tams) ... it could be just a quick fix need, but I don't really like to try to do quick-fix as it always seems to effect other things and make other problems.

Start simple, test, expand, test, etc. is my motto :-)

Anyway, since I have a similar indicator, just offering to share/help as best I can; not necessarily fix anything existing ... just giving back what I can as I get help from time-to-time as well. I'm not claiming anyone, myself included, right or wrong; just providing options :-)
mrtraderguy is offline  
Reply With Quote
Old 11-27-2009, 11:13 AM   #15

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,589
Ignore this user

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Help Needed For Indicator

the problem is...
most wishful thinkers write in mumble jumbles...


writing out their fantasy is easy,
but until people can write out their "wishes" one thought/one line at a time...
the codes will be mumble jumble too.

I have yet to be proven wrong on that.

;-)>
__________________


..........This is a terribly difficult question to answer. The only satisfactory answer is: "It depends"...

Last edited by Tams; 11-27-2009 at 11:24 AM.
Tams is online now  
Reply With Quote
Old 11-27-2009, 11:21 AM   #16

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Help Needed For Indicator

Mr T G, You can often learn something new by how others approach problem. There was a great thread "plotting globex highs and lows" or something similar. What was good about it is that several methods to do it where presented, some from fairly novice coders. Anyway reading back my post sounds unduly critical that was not my intention, apologies.
BlowFish is offline  
Reply With Quote

Reply

Tags
moving average

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Needed for Indicator DutchAngel Coding Forum 4 04-16-2009 06:22 AM
WOLFE WAVE Indicator Needed ropulos Coding Forum 29 12-24-2008 03:18 AM
Chaikin's Volatility Indicator Needed TipsyTzar Coding Forum 4 12-01-2008 03:25 AM
Indicators needed ( help) stocktrader.in Coding Forum 4 11-18-2008 02:44 PM
just what i needed xztheericzx Beginners Forum 0 11-04-2007 06:21 AM

All times are GMT -4. The time now is 12:10 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.