Locate price at mouse position

To add comments, please log in or register
Samuel Beer
514
Samuel Beer  

Hi guys

 

I want to code an alarm which i can drag from the navigator menu and drop it right on the chart. This "indicator" should place a horizontal line at exactly the price where i dropped it on the chart, giving me an alarm when price rises above (or falls below) that very price.

 

So this is my problem: How can i determine what the price is at the location where i dropped the indicator?

 

Thanks for your help :)

honest_knave
Moderator
2308
honest_knave  
ChartPriceOnDropped - Chart Operations - MQL4 Reference
ChartPriceOnDropped - Chart Operations - MQL4 Reference
  • docs.mql4.com
ChartPriceOnDropped - Chart Operations - MQL4 Reference
Roberto Jacobs
49955
Roberto Jacobs  
honest_knave:

ChartPriceOnDropped()

It was only for the EA or script.

Roberto Jacobs
49955
Roberto Jacobs  
RichPiano:

Hi guys

 

I want to code an alarm which i can drag from the navigator menu and drop it right on the chart. This "indicator" should place a horizontal line at exactly the price where i dropped it on the chart, giving me an alarm when price rises above (or falls below) that very price.

 

So this is my problem: How can i determine what the price is at the location where i dropped the indicator?

 

Thanks for your help :)

Use indicator with OnChartEvent() and then CHARTEVENT_OBJECT_CLICK and then CHART_EVENT_MOUSE_MOVE and then ChartXYToTimePrice and then draw the line. ^_^
honest_knave
Moderator
2308
honest_knave  
Roberto Jacobs:

It was only for the EA or script.

Indeed. But the OP also wanted to:

drag from the navigator menu and drop it right on the chart [...] place a horizontal line at exactly the price where i dropped it on the chart

So, there are several options to achieve this... Use a script, use an EA, or use a script in combination with an EA or indicator.

Advantages and shortcomings for all of them.

Samuel Beer
514
Samuel Beer  
Thanks all, I'll try it out :)
To add comments, please log in or register