Q: I’d like to retrieve, using GetStudy() I presume, parameters related to an Andrew’s Pitchfork which is already drawn on a Chart. I have no problem getting the handle of the Fork, but I can’t figure out what parameter numbers to use. I see there is supposed to be a block of parameters for Line Colors, from 300 to 310. Is that where I’d get the line colors?
In what format would that color be returned? I did get a large integer returned from parameter 300. Another item I want to retrieve is the Fork Variation. That is a string in a combo box with the choices, Standard, Schiff and Modified Schiff, as I recall. Also, if possible I’d like to get the tab selected for the drawing of the object, if that is available.
A: Yes, 300 through 310 are the selection parameters to use to get the line colors. Here is my test script for your review.
The example writes the values returned by GetStudy for 300 to 315. 300 returned the cyan color, and so did 301 in the example. The color Red is easy to spot as that has a color value of 255, and is returned by 303 and 305, etc. The colors are integers and contain the RGB bytes, with Red being the low order byte. Hence, the value 255 is just the color Red at its maximum brightness.
The fork variations selection value is 209. GetStudy(handle,209); First selection of Andrews would return 0. Schiff would return 1.
The TAB selected will be returned using selection 956. GetStudy(handle,956); 956 will work for all studies and tools to return the tab and the values will be 0 through 14.
Q: Thanks. I am totally satisfied with what you’ve provided. Is there an easy way to get the name of the Tab rather than just the number?
A: Yes, use 957 as the selection value to work with the tab’s text name. Example:
handle := FindStudy(eAndrews);
writeln( GetStudy(handle, 956) ) ; // write the current tab number
writeln( GetStudy(handle, 957) ); // write out the tab’s text name
SetStudy( handle, 957, ‘NewName’ ); // change the current tab’s text name