Code help please

This is a discussion on Code help please within the Trading Software forums, part of the Commercial category; The following code is supposed to draw angles from the H, L or C, but only draws a line from ...

Reply
 
LinkBack Thread Tools Search this Thread
Old May 9, 2005, 12:08am   #1
Joined Mar 2005
Code help please

The following code is supposed to draw angles from the H, L or C, but only draws a line from the LL regardless of settings — see chart 'Angle 1'.

Can you provide the code so lines will draw up or down from the H, L or C and also include the code to enter HHMM as well as the date so the indicator can be used on intraday charts.
Also is it possible for the line to 're-scale' as the scaling of the chart changes so the angle retains it's position thru the price bars.

I want to be able to draw user defined 'Gann Angle' lines. If you can create an 'Angle' indicator according to the requested requirements I'll provide a 'methodology' of how to use the 'Angle' to create a 'matrix' and how it might be used to assist in trading — see chart 'Angle 2'.

YMD := Input("Please enter date (YYYYMMDD)",
19010101,29991231,20050501);
Y0Type := Input("From 1-H, 2-L, 3-C",1,3,3);
Angle := Input("Angle",0,360,45);

{Build date counter}
xYMD := Year() * 10000 + Month() * 100 + DayOfMonth();

{Calculate slope from angle}
dY := Cos(Angle) / Sin(Angle);

{Draw angle when we hit the date}
(xYMD>=YMD)*dY+((Y0Type=1)*H+(Y0Type=2)*L+(Y0Type= 3)*C)*(Ref(xYMD,-1)=YMD)+PREV
Attached Thumbnails
angle-1.jpg   angle-2.jpg  
Trdr is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Da Vinci Code or TA? T2W Bot Educational Resources 12 Jul 17, 2006 2:30pm
TS 2000 code Trdr Trading Software 2 Apr 22, 2005 8:52pm
EL code question for TS TWI Trading Software 2 Aug 16, 2004 12:52pm
New code on QT for IB feed osho67 Trading Software 2 Nov 24, 2003 4:45pm

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)