Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Sign in to follow this  
aaa

Vertical Lines at Specified Time

Recommended Posts

// Vertical Lines at specified time

// author: aaa

// date: 20090516

//

// to see how the market reacts everydays specially Cash Opening and NY Opening or whatever you want

// holding the mouse at the end of a lines shows intraday price High Low difference

 

Please, feel free to correct my code if needed :newbie:

 

attachment.php?attachmentid=10765&stc=1&d=1242507814

Vertical Lines at specified time.txt

Snap2.jpg.9cb077981cab068a4d6fc60e8c198423.jpg

Share this post


Link to post
Share on other sites

Nice idea!

 

Very structured code!

 

 

 

 

Let's examine it a bit...

 

If you click on the trendline and drag it to one side, you will see another trendline sitting where it was before.

 

If you click on that trendline and drag it to one side, you will see yet another trendline sitting there.

 

The reason being this section of the code:

 

if PlotOpenCash <> 0 and time >= OpenCash then

 

 

MC will evaluate this condition time >= OpenCash at every bar.

If this condition is TRUE, MC will draw a trendline at "OpenCash".

 

At the next bar, MC will evaluate this condition again.

If the condition is true, it will draw another trendline (at the same place).

 

MC will draw a new trendline, again and again, at the same place, until end of the day.

 

 

Although the duplicated trendlines do not affect the chart, it will consume precious CPU power.

If you have a few indicators opened, it will slow down your computer.

 

 

To fix the problem, all you have to do is take the multiple condition away:

if PlotOpenCash <> 0 and time = OpenCash then

 

 

you can do the same with OpenNewYork.

Edited by Tams

Share this post


Link to post
Share on other sites

I was sure that they were a problem with the lines

 

Tams, you have Xray eyes

 

only > makes the difference from a wrong code to a correct code.

 

ThanX for the pedagogic explanation

Share this post


Link to post
Share on other sites
Nice idea!

 

Very structured code!

 

Thanx for your words of encouragement

 

The most I've learned comes from this forum

 

And this indicator was possible only with your gentle and clever support

Share this post


Link to post
Share on other sites

//-----------------------------------------------------
	inputs:
//----------------------------------------------------

PlotOpenCash( 	1   	),
PlotOpenNewYork( 	1   	),

 

 

I prefer to use

 

PlotOpenCash( True ),

PlotOpenNewYork( True ),

 

 

I found True/False is more intuitive at the Format Study window.

 

plus,

in EasyLanguage,

 

if PlotOpenCash = true then...

 

can be written as

 

if PlotOpenCash then...

 

 

1. "True" is implied.

2. the code looks cleaner without so many equal signs.

 

 

 

just a personal preference... makes no difference to the effectiveness of the code.

Share this post


Link to post
Share on other sites

Dear Tams

 

I agree with you ; Programing is an art.

 

Because I'm a lazy animal..

 

...I write down 0/1 oftenly in the format window instead of true/False wich is more source of faults.

Share this post


Link to post
Share on other sites

// Vertical Lines at specified time

// author: aaa

// Version 0.1

// date: 20090516

//

// date: 20090523

// Version 0.2

// Code cleaned by Tams

 

// to see how the market reacts everydays specially Cash Opening and NY Opening or whatever you want

// holding the mouse at the end of a lines shows intraday price High Low difference

 

attachment.php?attachmentid=10900&stc=1&d=1243068949

Vertical Lines at specified time 0.2.txt

Snap1.thumb.jpg.c450c8ad96d1157cf95675ffdd60461e.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.