Copy object values
-
I created a topic on this not too long ago, but for some reason it doesnt show on the forum.
I try to achieve something that i think is not too complex. I want to copy values from one source to another, and plot the results from this source in a TL afterwards.
When it comes to TL's there is no problem with time, but for prices i need the trendline to use the candle low or high found at time 1 and 2 (tl connection points)
Question: how do i make use of both candle ID’s that are connected to time 1 and time 2 of the first source? To then define whether the actual trendline needs to be drawn onto the candle low or high of corresponding candle ID on selected markets?
-
@robertk do you mean, how to measure if the TL is down sloping or up sloping?
-
@roar thanks for the quick respond Roar. I dont need to measure the slope, i only need to copy the source values and use that information to plot a TL.
Right now i am trying to look if i can somehow obtain the candle ID of those price points within a variable, and use that variable within copy attributes. No luck so far..
-
@robertk you dont know if the source TL is plotted to candle highs or lows?
-
@roar i do know this. If you draw a trendline and connect it to 2 candle lows, or 2 candle highs. Could you then explain me how i can grab the candle ID that is found at the times of these candle lows or highs?
-
If its still unclear i will make a small sample project on the builder tomorrow, or record it. Its quite important to me

-
@robertk still guessing, lol

Making visual things into math is often confusing.You want to convert regular time to candle time (candle ID)?
ibarshift() does that
https://docs.mql4.com/series/ibarshiftWhen you know the candle IDs of the source TL, you can use "trendline price by candle ID" to figure out all the info, can't you?
-
Edit: problem solved
-
@robertk
You can see your own posts by clicking you profile pic. This might be the topic you were looking for : https://fxdreema.com/forum/topic/11030/obtaining-trendline-values-and-redrawing-the-trendline/4
The link you did paste is missing a part
About taking the price by candle high/low in function of time, doesn't this block do the math ?

-
Edit: problem solved
-
Edit: problem solved
-
Edit: problem solved
-
Edit: problem solved
-
Edit: problem solved
-
@robertk "Chart ID" specifies the target chart. Apparently the fxdreema block doesn't have that parameter, so I'd guess you have to use the actual mql4 function in a custom code block
https://docs.mql4.com/objects/objectcreate -
Edit: problem solved
-
@robertk the custom code block replaces the "Draw line".
"Current market" has nothing to do with charts - the symbols aren't tied to any chart - but you still need that block for getting the proper prices. -
Edit: problem solved
-
@robertk behind the draw line block in fxdreema is this exact mql4 function, its just in graphical form with some nice drop down menus. You should be able to use the function, you have kind of used it before.