Automated distance calculation. How to make?
-
Does anyone have any idea how I can perform distance calculations between objects in a simpler and more automated way?
Currently I have to figure out which distance multiplier I should use to plot other lines on the chart.
I will cite some examples:
Note my lines R1, R2, R3 they are symmetrically spaced but for this to happen I had to multiply by x1000 note that the asset price is in the format 000,000In this case I'm using the Crypto market, but if I'm going to trade Forex, then I have to multiply it by x10000
If I'm going to use it in CFD I have to multiply by x100And these multipliers change from broker to broker.
Is there a way for the EA to find the ideal multiplier according to the price or something similar so that I don't have to keep trying to figure out this part?

-
@ontradingx said in Automated distance calculation. How to make?:
Does anyone have any idea how I can perform distance calculations between objects in a simpler and more automated way?
Currently I have to figure out which distance multiplier I should use to plot other lines on the chart.
I will cite some examples:
Note my lines R1, R2, R3 they are symmetrically spaced but for this to happen I had to multiply by x1000 note that the asset price is in the format 000,000In this case I'm using the Crypto market, but if I'm going to trade Forex, then I have to multiply it by x10000
If I'm going to use it in CFD I have to multiply by x100And these multipliers change from broker to broker.
Is there a way for the EA to find the ideal multiplier according to the price or something similar so that I don't have to keep trying to figure out this part?

price %? eh. probably not.
Its very difficult because every asseet , each measurement will change. Pips, Ticks, Points, Price, Price %. Its all variable and not on the same scale. But of all of them, price % is probably the most universal.
-
@tipsywisdom could you give me an example of how to do this?
-

I didnt double check the formula, but I think this is right...or the logic is close, but this is the idea. Turn any price move into a variable with a formula.
This is how I would use 10% of price for example, as a variable. -
@ontradingx If you have the value for each line, high - low will give you the distance.