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

Reply
Old 02-04-2008, 09:58 AM   #9

Blu-Ray's Avatar

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

Thanks: 164
Thanked 288 Times in 105 Posts



Re: TTM/DDF Value Chart

Quote:
Originally Posted by Soultrader »
HI Blu-Ray,

The code would be perfect if you dont mind. I am trying to replicate this in IRT. Thanks
Sure here goes, the first part is for the function VChart:

Inputs:NumBars(Numeric),P rice(NumericSeries);

Variables:VarNumBars(0),V ar0(0),LRange(0),YDiv(0), RanVar4(0),VOpen(0),VHigh (0),VLow(0),VClose(0),
VarA(0),VarB(0),VarC(0),V arD(0),VarE(0),VarP(0),Va rR1(0),VarR2(0),VarR3(0), VarR4(0),VarR5(0);

{Insure NumBars is between 2 and 1000}
If NumBars < 2 then VarNumBars = 2;
If Numbars > 1000 then VarNumBars = 1000;
If Numbars >= 2 and NumBars <=1000 then VarNumBars = NumBars;

VarP=Round(VarNumBars/5,0);

If VarNumBars >7 then begin
VarA=Highest(H,VarP)-Lowest(L,VarP);
If VarA = 0 and VarP=1 then VarR1=absvalue(C-C[VarP]) Else VarR1 = VarA;
VarB=Highest(H,VarP)[VarP+1]-Lowest(L,VarP)[VarP];
If VarB = 0 and VarP=1 then VarR2=absvalue(C[VarP]-C[VarP*2]) Else VarR2 = VarB;
VarC=Highest(H,VarP)[VarP*2]-Lowest(L,VarP)[VarP*2];
If VarC = 0 and VarP=1 then VarR3=absvalue(C[VarP*2]-C[VarP*3]) Else VarR3 = VarC;
VarD=Highest(H,VarP)[VarP*3]-Lowest(L,VarP)[VarP*3];
If VarD = 0 and VarP=1 then VarR4=absvalue(C[VarP*3]-C[VarP*4]) Else VarR4 = VarD;
VarE=Highest(H,VarP)[VarP*4]-Lowest(L,VarP)[VarP*4];
If VarE = 0 and VarP=1 then VarR5=absvalue(C[VarP*4]-C[VarP*5]) Else VarR5 = VarE;
LRange=((VarR1+VarR2+VarR 3+VarR4+VarR5)/5)*.2;
End;


If VarNumBars <=7 then Begin
If AbsValue(C-C[1]) > (H-L) then Var0=AbsValue(C-C[1]) else var0=(H-L);
If H=L then Var0=absvalue(C-C[1]);
LRange=Average(Var0,5)*.2 ;
End;

If LRange > 0 then begin
If Price = Open then
VChart=((Open-Average((H+L)/2,VarNumBars)))/(LRange);
If Price = High then
VChart=((High-Average((H+L)/2,VarNumBars)))/(LRange);
If Price = Low then
VChart=((Low-Average((H+L)/2,VarNumBars)))/(LRange);
If Price = Close then
VChart=((Close-Average((H+L)/2,VarNumBars)))/(LRange);
End;


and the second part is the indicator

Inputs:NumBars(5);
Variables:Vopen(0),VHigh( 0),VLow(0),VClose(0),Var1 (0),Var2(0);
Var: VcloseLam(0),ValueSOB(" "),ValueMOB(" "),ValueMOS(" "), ValueSOS(" "), ValueFair(" "), lastdate(0);


{Calcualte Value Chart}
VOpen = VChart(NumBars,Open);
VHigh = VChart(NumBars,High);
VLow = VChart(NumBars,Low);
VClose = VChart(NumBars,Close);


If currentbar > Numbars then Begin
Plot1(VOpen,"VOpen");
Plot2(VHigh,"VHigh");
Plot3(VLow,"VLow");
Plot4(VClose,"VClose");
Plot5(8,"8");
Plot6(4,"4");
Plot7(-4,"-4");
Plot8(-8,"-8");
Plot9(0,"0");
End;


Cheers

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
The Following User Says Thank You to Blu-Ray For This Useful Post:
HBBHVN (12-04-2008)
Old 02-04-2008, 10:20 AM   #10

Soultrader's Avatar

Status: Super Moderator
Join Date: Aug 2006
Location: Tokyo
Posts: 3,618
Ignore this user

Thanks: 545
Thanked 1,345 Times in 483 Posts
Blog Entries: 4



Re: TTM/DDF Value Chart

Thank you very much Blu-Ray. Much appreciated.
__________________

Soultrader is offline  
Reply With Quote
Old 02-04-2008, 11:23 AM   #11

LS_Chad's Avatar

Status: Partner
Join Date: Mar 2007
Location: Atlanta, GA
Posts: 224
Ignore this user

Thanks: 0
Thanked 76 Times in 59 Posts



Re: TTM/DDF Value Chart

I've studied the code Blu-Ray shared and am attempting to recreate the Value Chart in Investor/RT. Here is what I have come up with so far:

Images | ChartHub.com



However, comparing my chart with the charts in the videos wsam posted, my charts seem to oscillate at a much slower rate. Is it possible that a different VarNumBars was used in those videos (200 maybe instead of 1000)? Can somehow compare my charts with a 2-min of ES in TS and let me know how it compares.

Thanks
LS_Chad is offline  
Reply With Quote
Old 02-04-2008, 05:40 PM   #12

Blu-Ray's Avatar

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

Thanks: 164
Thanked 288 Times in 105 Posts



Re: TTM/DDF Value Chart

Hi Chad

Here's a pic of the TS screen with the value chart attached.



With regards to the VarNumBars, the setting is 5. What you're reading is the part within the function that constrains the inputs, if someone were to put in 1050 as the NumBars then TS will only allow it to be 1000 max.

Hope this helps

Blu-Ray
Attached Thumbnails
TTM/DDF Value Chart-valuechart.png  
__________________

“ 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 02-04-2008, 06:43 PM   #13

LS_Chad's Avatar

Status: Partner
Join Date: Mar 2007
Location: Atlanta, GA
Posts: 224
Ignore this user

Thanks: 0
Thanked 76 Times in 59 Posts



Re: TTM/DDF Value Chart

OK, that explains it. Thanks Blu-Ray. I created this one with a period of 5. If anyone has a TS chart to compare it to, let me know how it stacks up. Thanks.

[media]http://www.charthub.com/images/2008/02/04/ValueChart_2.png[/media]

LS_Chad is offline  
Reply With Quote
The Following User Says Thank You to LS_Chad For This Useful Post:
MC (02-04-2008)
Old 02-04-2008, 06:58 PM   #14

Blu-Ray's Avatar

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

Thanks: 164
Thanked 288 Times in 105 Posts



Re: TTM/DDF Value Chart

It looks like you've cracked it, here's the chart



Cheers

Blu-Ray
Attached Thumbnails
TTM/DDF Value Chart-valuechart1.png  
__________________

“ 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 02-04-2008, 07:44 PM   #15
MC

MC's Avatar

Join Date: Sep 2007
Location: NY
Posts: 533
Ignore this user

Thanks: 180
Thanked 52 Times in 40 Posts



Re: TTM/DDF Value Chart

Good stuff...I've been looking at Investor RT, nice to see we have people with programming skills on here. Might make my decision easier.
__________________
Looking for a top notch market interaction & analysis blog? Visit www.TradersBase.com
MC is offline  
Reply With Quote
Old 02-04-2008, 09:10 PM   #16

Soultrader's Avatar

Status: Super Moderator
Join Date: Aug 2006
Location: Tokyo
Posts: 3,618
Ignore this user

Thanks: 545
Thanked 1,345 Times in 483 Posts
Blog Entries: 4



Re: TTM/DDF Value Chart

Looks great Chad. Can we throw this IRT version up in the Trading Indicators forum?
__________________

Soultrader is offline  
Reply With Quote

Reply

Tags
ttm, value trading

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
YM Chart 7/27/07 TinGull The Candlestick Corner 2 07-30-2007 08:54 AM
a VSA chart a Day flatwallet Beginners Forum 27 05-05-2007 01:41 PM
Chart-ex.com torero Trading Products and Services 1 04-01-2007 09:35 PM
Chart Set-up wsam29 Market Analysis 10 03-05-2007 05:13 PM
MP Chart TinGull Market Profile 2 12-09-2006 01:03 AM

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