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

Reply
Old 11-24-2009, 04:59 AM   #1

Join Date: Jul 2009
Location: Paphos
Posts: 36
Ignore this user

Thanks: 9
Thanked 6 Times in 1 Post

Help Needed For Indicator

Hi,

I am running a show me on TS 8.6.

The idea is that it will plot a show me when both the fast and slow averages are pointing up, when on the previous bar, either the fast or slow average were not pointing up.

The problem I am having is that once a show me is plotted, further plots are made, which I do not want, I only want the plot when both averages are pointing up, when on the previous bar either one or the other were not pointing up, then i do not want any further plots until at some time in the future, the obove occurs again.

I attach a chart, with arrows showing where the plots should be, as the show me, which as you can see in not plotting correctly.

Below is the code that I have.

Many thanks for all your continued help guys.

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

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

Value1=LOW ;

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

if fastvalue<=fastvalue[1] or slowValue <= slowValue[1] then
longTrigger = false;


If FastValue>FastValue[1] and slowvalue>slowvalue[1]
and close>open then longTrigger = true;

longTriggerValue = High +( range * BEx );

if longTrigger=true then Plot1(Value1);
If longtrigger=true then Plot2(LongTriggerValue);
Attached Thumbnails
Help Needed For Indicator-screenshot.gif  
nab999 is offline  
Reply With Quote
Old 11-24-2009, 08:10 AM   #2

Tams's Avatar

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

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Help Needed For Indicator

if you wrap your indicator in Code Tag (the # icon at the top of the reply window),
you codes will be enclosed in a easy-to-read code window.
__________________



Only an idiot would reply to a stupid post

Last edited by Tams; 11-24-2009 at 08:40 AM.
Tams is offline  
Reply With Quote
Old 11-24-2009, 08:16 AM   #3

Tams's Avatar

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

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Help Needed For Indicator

Quote:
Originally Posted by nab999 »
...
The idea is that it will plot a show me when both the fast and slow averages are pointing up, when on the previous bar, either the fast or slow average were not pointing up.
....

my suggestion:

Write out your ideas:
ONE thought at a time,
ONE logic at a time,
ONE action at a time,
ONE LINE PER PHRASE,
ONE phrase per sentence
ONE LINE per sentence...

if you have more than one thought in the same sentence, you are cooked.
if you have more than one phrase in the same line, you are cooked.

write it as if you were writing the code,
write it as if the machine is reading it... one line at a time, one action at a time.

if you can do that... you will see your coding solution easily.
__________________



Only an idiot would reply to a stupid post

Last edited by Tams; 11-24-2009 at 08:26 AM.
Tams is offline  
Reply With Quote
Old 11-24-2009, 11:16 AM   #4

Join Date: Jul 2009
Location: Paphos
Posts: 36
Ignore this user

Thanks: 9
Thanked 6 Times in 1 Post

Re: Help Needed For Indicator

Hi Tams, sorry about the code box, I hit the quote box my mistake.

I have put it down as you suggested, i.e. the code that almost works is shown....

The problem I have is that it is not producing the results that I want, as explained in my initial post. I am not a very good easy language coder at all, and can not get any further with it myself, hence my request for some help.
nab999 is offline  
Reply With Quote
Old 11-24-2009, 11:22 AM   #5

Tams's Avatar

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

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Help Needed For Indicator

Quote:
Originally Posted by nab999 »
...
I have put it down as you suggested....

but I don't see what you wrote...
can't help you if I don't see it.

writing out the thoughts line by line is a way to
line up your logic

computers are very stupid,
it can only do what you tell it to do.

your instruction has to be direct and complete
for the computer to do what you want to do

if the computer is not doing what you want to do,
there is only one explanation:
your logic is incomplete

i.e. you haven't got all the bases covered.



p.s. it is good that you have posted a chart,
you need to write some notes on the chart to
point out what is wrong with the picture.
You can also draw some lines and arrows and notes
to illustrate what you have in mind.
__________________



Only an idiot would reply to a stupid post

Last edited by Tams; 11-24-2009 at 11:43 AM.
Tams is offline  
Reply With Quote
Old 11-25-2009, 06:19 AM   #6

BlowFish's Avatar

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

Thanks: 129
Thanked 1,054 Times in 702 Posts

Re: Help Needed For Indicator

Set longtrigger=false right at the start of your code or

where you have the if statement add else false.

If FastValue>FastValue[1] and slowvalue>slowvalue[1]
and close>open then longTrigger = true
else
longtrigger = false;
BlowFish is offline  
Reply With Quote
The Following User Says Thank You to BlowFish For This Useful Post:
nab999 (11-29-2009)
Old 11-25-2009, 09:58 PM   #7

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:
The idea is that it will plot a show me when both the fast and slow averages are pointing up, when on the previous bar, either the fast or slow average were not pointing up.
Does this mean you want a slope calculation on the plots? So you want to know when some point A followed by point B is negative in slope and then point C is positive in slope for two separate averages?

As an example data set:

------------ Avg1 -------- Avg2
Time1 -- 12 ---------- 10
Time2 -- 10 ---------- 9
Time3 -- 11 ---------- 10

In the above, each average moves down from Time1 to Time2 then up from Time2 to Time3 but they do not cross in this example data set here.

I do this with crossing action, but not for slope change ... so curious exactly what you're asking, just to be clear :-)
mrtraderguy is offline  
Reply With Quote
Old 11-26-2009, 03:17 AM   #8

Join Date: Jul 2009
Location: Paphos
Posts: 36
Ignore this user

Thanks: 9
Thanked 6 Times in 1 Post

Re: Help Needed For Indicator

Hi MrTraderGuy

Yes, what I am looking for is a Bar A followed by Bar B Formation....

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.

Many thanks.
nab999 is offline  
Reply With Quote

Reply

Tags
moving average

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


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

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