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

Reply
Old 09-24-2009, 09:40 AM   #1

Join Date: Jun 2009
Location: hemel
Posts: 87
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Realtime Dilema!!

Hi

I have writtent his code to plot a dot under the right conditions. This usally works fine but if the conditions change on that same plot then it reverts to its default colour!

How can i get around this happening so that it removes the plot or something if conditions change!

here is the code

if cti= 0 and Value1 > Value1[1] and Value2 > Value2[1] and barColor = barColor[1]


then begin
SetPlotColor( 4, green ) ;
Plot4(low,"testy");

but if it plot a green dot and the price goes the other way on that candle it just removes the colour and keeps a pink dot!!



Thanks

Last edited by chrisleonard; 09-24-2009 at 10:07 AM.
chrisleonard is offline  
Reply With Quote
Old 09-24-2009, 10:07 AM   #2

Join Date: Jun 2009
Location: hemel
Posts: 87
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Re: Realtime Dilema!!

is there something i can do?

Maybe some code to say if these conditions change before the candle closes to remove the plot?
chrisleonard is offline  
Reply With Quote
Old 09-24-2009, 10:58 AM   #3

Blu-Ray's Avatar

Join Date: Nov 2006
Location: England
Posts: 508
Ignore this user

Thanks: 164
Thanked 292 Times in 105 Posts

Re: Realtime Dilema!!

Try this:

if cti= 0 and Value1 > Value1[1] and Value2 > Value2[1] and barColor = barColor[1]


then Plot4(low,"testy",green) else NoPlot(4);
__________________

“ Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want ” – Eric Schmidt, Google
Blu-Ray is offline  
Reply With Quote
Old 09-24-2009, 11:12 AM   #4

Join Date: Jun 2009
Location: hemel
Posts: 87
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Re: Realtime Dilema!!

Hi Blu-Ray that seems to do the trick wow thanks so much for that!!
chrisleonard is offline  
Reply With Quote
The Following User Says Thank You to chrisleonard For This Useful Post:
Blu-Ray (09-24-2009)
Old 09-24-2009, 11:56 AM   #5

Join Date: Jun 2009
Location: hemel
Posts: 87
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Re: Realtime Dilema!!

hmm maybe some quick syntax help here please as when i add this to another alert with text it causes problems!

if
(cti = 0 and Value1 > Value1[1] and Value2 > Value2[1] and barColor = barColor[1]) or
(cti = 0 and Value1 > Value1[1] and Value2 > Value2[1] and barColorpl = barColorpl[1])


then begin
cti = 1;
Plot4(low,"test",green);
ID = Text_New(D,T,L-range, "S:"); < ------------ how do i get rid of this if the plot is removed???
end
else
noplot(4);
end;
chrisleonard is offline  
Reply With Quote
Old 09-24-2009, 12:14 PM   #6

Blu-Ray's Avatar

Join Date: Nov 2006
Location: England
Posts: 508
Ignore this user

Thanks: 164
Thanked 292 Times in 105 Posts

Re: Realtime Dilema!!

Quote:
Originally Posted by chrisleonard »
hmm maybe some quick syntax help here please as when i add this to another alert with text it causes problems!

if
(cti = 0 and Value1 > Value1[1] and Value2 > Value2[1] and barColor = barColor[1]) or
(cti = 0 and Value1 > Value1[1] and Value2 > Value2[1] and barColorpl = barColorpl[1])


then begin
cti = 1;
Plot4(low,"test",green);
ID = Text_New(D,T,L-range, "S:"); < ------------ how do i get rid of this if the plot is removed???
end
else
noplot(4);
end;
This should do the trick :

if (cti = 0 and Value1 > Value1[1] and Value2 > Value2[1] and barColor = barColor[1]) or
(cti = 0 and Value1 > Value1[1] and Value2 > Value2[1] and barColorpl = barColorpl[1])

then begin
cti = 1;
Plot4(low,"test",green);
ID = Text_New(D,T,L-range, "S:");
end else begin
noplot(4);
Value1 = Text_Delete(ID);
end;


Hope this helps

Blu-Ray
__________________

“ Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want ” – Eric Schmidt, Google
Blu-Ray is offline  
Reply With Quote
Old 09-24-2009, 12:23 PM   #7

Blu-Ray's Avatar

Join Date: Nov 2006
Location: England
Posts: 508
Ignore this user

Thanks: 164
Thanked 292 Times in 105 Posts

Re: Realtime Dilema!!

Just food for thought .............. if you're ever stuck on coding issues... the best thing to do is write it down in front of you.

Then think.... " How can I get around that? "... or ... " Is there a function / reserved word that would do the trick for me? "

Then open up the Easy Language dictionary within TS and just type a word roughly that will solve you problem.

For example your last query.

How can I get the text to disappear.

Type text into the dictionary and some results will appear, scroll down and see whats available that might match your needs within easy language.


This way you'll build up your own knowledge of what words to use in the future.. keep doing this and you'll soon be flying.

This is how I learned and it's great info to know.

Hope this helps

Blu-Ray
__________________

“ Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want ” – Eric Schmidt, Google
Blu-Ray is offline  
Reply With Quote
Old 09-24-2009, 12:26 PM   #8

Join Date: Jun 2009
Location: hemel
Posts: 87
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Re: Realtime Dilema!!

Hi there,

all of you help has been invalueble seriously mate, thank you.

I typed this in

then begin
cti = 1;
Plot4(low,"test",green);
ID = Text_New(D,T,L-range, "S:");
end else begin
noplot(4);
Value1 = Text_Delete(ID);
end;

but this never plots any text now, the rest is fine, any ideas?
chrisleonard is offline  
Reply With Quote

Reply

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
Realtime Trading Platform Based on Matlab davidez Automated Trading 7 09-30-2010 09:52 AM
This Looks Like a Very Interesting Way to Track Market Sentiment in Realtime. popstocks Trading and the Markets 8 09-14-2010 01:19 PM
Volatility Indexes (VIX,VDAX,etc) Realtime Data Provider paolfili Trading and the Markets 0 07-20-2009 05:47 PM
Free realtime chart for YM sudha78 Technical Analysis 22 11-29-2007 01:11 PM
Realtime Price into XLS Cell aidaweb01 Technical Analysis 2 09-24-2007 12:45 PM

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