How to create input based on cursor position?

 
Hello,

i want to programm a modified pitchfork, cos the built in one is crap.

The built in pitchfork, has 3 inputs: you have to click 3 positions in the chart, so that the pitchfork can be drawn by MT 4.

So, how can i program this type of input? Cant find it in the help file :(
 
Can't do it that way, exactly, you have to draw objects and work from them.

You might start with a triangle...

In my case, I start with a single line, one anchor point (time and price), and one time point. The rest is calculated.
 
could you send me your version plz`?
 
I'm responding to your original statement...

"Hello,
i want to programm a modified pitchfork..."
 
mhm yes yes, but i have no idea of the input thingy. could you even give me a hint or so? or the code for the input at least?
 
My implementation operates like this:

User moves the starting point of the median line to the desired pivot point.

The length of the line determines the other price points that will be included in the median line calculation.

Step though all the bars contained by the median line, and calculate the slope of the median line. I use brute force method, by adjusting the angle of the line until it settles on the slope where the highest high above the line is equal distance from the lowest low below the line (that is my definition of a median line).

Iteration... if the high is more distant than the low, increase the slope of the median line. if the low is more distant than the high, decrease the slope of the median line.

Note the final slope of the median line, and the distance of the high or low from the median line.

Draw parallel lines with the same slope, crossing the selected high and low.

Add parallel "warning" lines as desired, same slope, calculating the distance.

---

So, I pick an anchor, and the median line "snaps" into position, and the parallel lines follow.

If the second timepoint is at bar0, it tracks bar0, extending the median line as time passes. If price gets outside
the main parallels, they expand. If I want a "fixed" fork, then I select a postion for the second timepoint of the
median line prior to bar 0.


http://i30.tinypic.com/fvv78y.png
 
ah ok. but i notice you use the standard pf as well. my modification does work much better.

Basicly the lines of your fork are great, but imho the angle is wrong.

maybe i can help you to improve your fork while you send me your code? :) im ready to mail you a picture of my pf

id appreciate if you contact me via mail: handyschlumpf@freenet.de


greets mathias
 
"my modification does work much better"

Ok.

"Basicly the lines of your fork are great, but imho the angle is wrong"

It is a median line for the chosen time span. It can be drawn from a pivot (as shown), using a Schiff line,
or from any discretionary point desired. In all cases, it calculates a median line. That is my intent for the tool.

"maybe i can help you to improve your fork"

Maybe.

"id appreciate if you contact me via mail"
"im ready to mail you a picture of my pf"

Post it here.
 
here it is:


I used the built in pf for drawing and changed the angle...

It reflects the same gbpusd daily as your screenshot. But i did not need several months of history for those forks.
 
i solved the problem by myself without programming. i notced there is another built in charting tool with 3 mouse-click-inputs.

Thank you for helping anway.
Reason: