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

Reply
Old 05-09-2009, 04:37 AM   #1
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 443
Ignore this user

Thanks: 240
Thanked 283 Times in 136 Posts

How to Plot Automatically a Moving Period ?

I use this to begin to plot an indicator at a precisedd date before

inputs:
iStartDate( 1090505 ),

If date this bar >= iStartDate
then begin
end;

How to plot automatically a moving period ?

ex:
condition
plotting 3 moving days before today

result
today 09-may
plot from 06 > 09
tomorrow is 10-may
plot from 09 > 10
etc...
aaa is offline  
Reply With Quote
Old 05-09-2009, 02:53 PM   #2

Tams's Avatar

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

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

Re: How to Plot Automatically a Moving Period ?

can you post a mock up?

is this for daily chart?
Tams is offline  
Reply With Quote
Old 05-10-2009, 06:05 AM   #3
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 443
Ignore this user

Thanks: 240
Thanked 283 Times in 136 Posts

Re: How to Plot Automatically a Moving Period ?

Dear Tams,

A single chart/dream is more powerfull than a thousand of word/realities "Shaaakspeaaare"

How to have an indicator wich starts automatically xDays before and move with the currentday

It could be mn, HH, DD, WW, MM

It is for saving precious ressources

The chart should be always like this everyday

Cheers
Attached Thumbnails
How to Plot Automatically a Moving Period ?-untitled-1.jpg  
aaa is offline  
Reply With Quote
Old 05-10-2009, 08:12 AM   #4

Tams's Avatar

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

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

Re: How to Plot Automatically a Moving Period ?

Quote:
Originally Posted by aaa »
It is for saving precious ressources
with today's computer... I don't think you need to worry about CPU power.
open your Task Manager and you will your CPU is running below 20% most of the time.


furthermore...

the moving average is only calculated ONCE...
and plotted ONCE on your chart.
and updates only if there is a change on the chart.

if you use the function averageFC() instead of average(),
it uses even less computing power.



Quote:
Originally Posted by aaa »
How to have an indicator wich starts automatically xDays before and move with the currentday...

the easiest way is to control the plot:

if d > (currentdate - lookback) then plot1( MovingAverage, "MA");


.

Last edited by Tams; 05-10-2009 at 08:41 AM.
Tams is offline  
Reply With Quote
The Following User Says Thank You to Tams For This Useful Post:
aaa (05-10-2009)
Old 05-10-2009, 05:16 PM   #5
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 443
Ignore this user

Thanks: 240
Thanked 283 Times in 136 Posts

Re: How to Plot Automatically a Moving Period ?

It looks always so simple when you give me the solution.

I am shame to be so bad...

It is not for the MM but for the indicators wich draw a lot of lines

I like to use very long period back and I noticed a slow down with certains indicators
aaa is offline  
Reply With Quote
Old 05-10-2009, 05:52 PM   #6

Tams's Avatar

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

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

Re: How to Plot Automatically a Moving Period ?

PLOT does not use much computing power because each plot is only calculated ONCE.

however drawing objects are recalculated again after each tick and re-drawn on the screen again even if there are no changes to their placement on the chart.
drawing objects are: TL_new(), ARW_new(), TEXT_new()

if you right click on the chart, a window will pop up.
select Format drawings...
you will see the number of drawing objects you have on that chart.
I have 4000+ drawing objects on some of my charts, they haven't caused any slow down yet.
Tams 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
Plot Option Volume On Chart? cbratton Options Trading Laboratory 5 06-11-2009 12:06 AM
Anyway to Plot an Indicator Value Without Actually Plotting It? daedalus Coding Forum 3 04-24-2009 11:43 PM
Making TS Plot Wider daedalus Coding Forum 14 04-23-2009 10:37 AM
Average Holding Period in U.S. Stock Indexes and U.S. Treasuries AgeKay Futures Trading Laboratory 3 12-19-2008 05:21 PM
How to plot MP using IB data feed? jj2005 Market Profile 0 03-14-2007 10:34 AM

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