[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DLL question: Chart Text positioning, FindArray_High() & price array boundries



PureBytes Links

Trading Reference Links

I received a private email on this topic, so I thought I'd send an update 
to the list.

The author mentioned he had tried some of these functions back when using 
SP2/3 and he found them to be quite buggy/unreliable and incorrectly 
documented.  He was wondering if things might be working better in SP5.

My response:
=======================
I don't know.  I think I'm still at SP2 or 3.  If I recall properly I got 
one of them working (relative to my OR-standards) and then heard the next 
SP had all kinds of problems, so I just stopped there.  My current version 
in Help->About is 5.00.0563.

I haven't noticed any bugs in the FindAddress_XXXX() functions -- but 
things do go awry when I point too far off one of the ends of the price 
arrays.  On the other hand, I'm currently only using them in a very limited 
fashion (for placing text at the high of 10 bars before and after the 
current bar).

Near the left or right side of the price arrays (I'm only backtesting at 
this point; no real-time) it seems to return 0's -- but if you go too far, 
TS will catch an exception and bomb out.  I've tried to surround the calls 
with a try/catch in VC++, but that didn't get it (which makes sense).  At 
the moment, if I see a 0 (meaning I hit one end), I just make sure I don't 
look any further.  It's still pretty unsafe code, but I'm going with it at 
the moment since I can't think of any way to predict where the end of my 
price bars will be (and since it's not critical code for me and I'm busy 
elsewhere).

I can obviously determine where the left side of the price array is by 
passing the BarNumber value from EasyLanguage to the DLL.  I just don't 
know how to tell how many bars exist off into the future.

Dave

At 12:24 PM 6/29/00 -0400, you wrote:
>Greetings,
>
>I'm doing 99.9% of my Tradestation coding in C++ these days and I'm 
>looking for creative ways to position text on a chart. [basically at this 
>point my DLL has all of my system code and also tracks entries, exits, 
>positions, etc and I only use TS as a means of loading data and graphical 
>output -- eventually TS will go away altogether].
>
>At the moment I'm trying to place my entry and exit markers on the 
>chart.  An example is "^3/5"  (^ = long entry, 3 = size, 5 = resulting 
>position size).  I'll also need to drop a code in there to identify the signal.
>
>I was just positioning the text vertically at the High for a long and at 
>the Low for a short.  Since it takes some space, I'd like to raise it up 
>above the surrounding bars.
>
>I considered using FindArray_High() with both positive and negative 
>indexes to find the high of the 15 bars before and after the bar I'm 
>plotting at.
>
>I can't find any info in the dev kit about what happens when you give an 
>index into FindArray_XXXX() that is off the end of the array (on either 
>side).  I gave it a test run and I seem to get 0's back -- that's good if 
>I can trust it.  Can I?  At the moment it doesn't seem consistant.  Anyone 
>have experience here?  Does anyone have any tricks to know where the end 
>of the array is?
>
>Any other creative thoughts on text positioning?
>
>Another big challenge I've run across is "stacking" text or showmes in a 
>clean manner.  The big problem here is that you have to poisition text 
>vertically via price and the vertical scale of the chart changes as you 
>move left and right.  One "hack" I've done here in the past was to create 
>a function that looks at the average range of the last X bars and use a 
>portion of that as the distance between stacked text.
>
>Dave
>david_wieringa@xxxxxxxx
>Scottsdale, AZ

david_wieringa@xxxxxxxx
Scottsdale, AZ