Hi Friends,
I draw a horizontal line the chart say at price 1.14500 ( Previous Value)
Now the market moves the my new horizontal line is 1.12345 (Current Value)
I want to show these in the Chart like
Previous Position of Pivot Line is x.xxxxx Present Position is x.xxxxx
I am trying lot of codes but it shows current pivot value for both. Though i am pro coder.
Thanks in advance
Documentation gives you the answer
https://www.mql5.com/en/docs/constants/objectconstants/enum_object/obj_hline

- www.mql5.com
Documentation gives you the answer
https://www.mql5.com/en/docs/constants/objectconstants/enum_object/obj_hline
This is not what i am looking boss. I created a line at a price (X) for given condition. Later stage the price (X) changes for the given condition.
Here there are two value for X.
Now the problem is I want to recall
Previous value is X
Present value is X
preblueline=data[pos][1]; if(data[pos][1]>Open[0]) { blueline=data[pos][1]; } if(data[pos][1]<Open[0]) { blueline=data[pos][1]; } if (preblueline!=blueline){preblueline=blueline;}
Please explain what you are trying to achieve with this block of code.
Please explain what you are trying to achieve with this block of code.
I created a line at a price (X) for given condition. Later stage the price (X) changes for the given condition.
Here there are two value for X. which i would call as Previous value and present value.
Now the problem is I want to store them separaetely and recall later
Previous value is X
Present value is X
You need code that saves the previous value when you update the current value?
preblueline=data[pos][1]; if(data[pos][1]>Open[0]) { blueline=data[pos][1]; } if(data[pos][1]<Open[0]) { blueline=data[pos][1]; } if (preblueline!=blueline){preblueline=blueline;}
this is not working bro
I created a line at a price (X) for given condition. Later stage the price (X) changes for the given condition.
Here there are two value for X. which i would call as Previous value and present value.
Now the problem is I want to store them separaetely and recall later
Previous value is X
Present value is X
I am not sure what you are trying to do.
preblueline=data[pos][1]; if(data[pos][1]>Open[0]) { blueline=data[pos][1]; } if(data[pos][1]<Open[0]) { blueline=data[pos][1]; } if (preblueline!=blueline){preblueline=blueline;}
Can be simplified to
preblueline=data[pos][1]; if(data[pos][1]!=Open[0]) blueline=data[pos][1]; else preblueline=blueline;
I am not sure what you are trying to do.
Can be simplified to
i am getting the same value for both the lines. What i want is Preblueline is previous value and Blue is current value. Help me please
i am getting the same value for both the lines. What i want is Preblueline is previous value and Blue is current value. Help me please
The problem is that you are talking about price(x) and you don't use x in your code.
What is data[pos][1] ?
The problem is that you are talking about price(x) and you don't use x in your code.
What is data[pos][1] ?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Friends,
I draw a horizontal line the chart say at price 1.14500 ( Previous Value)
Now the market moves the my new horizontal line is 1.12345 (Current Value)
I want to show these in the Chart like
Previous Position of Pivot Line is x.xxxxx Present Position is x.xxxxx
I am trying lot of codes but it shows current pivot value for both. Though i am pro coder.
Thanks in advance