please I need your help when
When have a signal, a buy or sell an order is executed
I'm still waiting for another a candle from the signal to draw a ray
so I have:
BarAgo=Currentbar-1 -------------------->signal
Currentbar
with these two informations I can calculate the slope
x1 = ChartControl.GetXByTime(myRay.StartAnchor.Time);
x2 = ChartControl.GetXByTime(myRay.EndAnchor.Time);
y1 = myRay.StartAnchor.Price;
y2 = myRay.EndAnchor.Price;
slope = (y1 - y2) / (x1 - x2);
now the market is moving
I have some questions
- By using this ray (slope) I would like to add a condition so that no order is executed until there is a crossover.
after my remarks there will be signals and false signals so I must avoid them
- how to calculate the crossover point ( price crossing the ray)
I am working on that one. But I don't know the result yet.
X3 = ChartControl.GetXByBarIndex(ChartBars, Bars.Count - 1);
y3 = y1 - slope * (x1 - x3);
Thank you for your patience and the time you devote to us

Comment