I have a question about the attached EA i created. As you can see, the attached EA works with supertrend and halftrend indicator. Whenever supertrend says "TrendUp" and an up arrow occurs, a buy Order will be set, and the same with sell positions in the opposite. Now i have problems in two areas.
First i want the EA to open positions, as soon as the bar crosses the the SuperTrend line. So my idea is to program, if the ask price movs above the supertrend value, an order will be open. I would prefer the most if the condition would be with the current price value but i dont know which variable it is ? (Maye Mode_Point ?) You can see what i mean in the attached picture !!! Therefore i programmed the following sellstop but i doesnt work !
The second question is about the closing condition. I want the current Position to be closed, at the point where TrendUp changes to TrendDown, and the opposite. when i look up the values in the data window, i see that at this point the TrendUp and the TrendDown have the same values !! But if i put "tu==td" into the close condition nothing happens, as well as you see with "tu!=EMPTY_VALUE && td!=EMPTY_VALUE". Its only working with with "td>0.000000001 && td<9999999" but this value of course occurs 1 bar later. The idea is that i want to close the positions as soon as possible ! You can see my close command code below:
In the attachement you find my EA as well as the super-trend indicator i use ! I am not the most experienced coder, but i dont see why its not working !! I would be very thankful for any help or suggestions !!!