I'm just starting to learn writing EA script. So, forgive me for such a newbie question.
I'm using iADX. And part of my code:
[script]
[/script]
Image attached is created after I run the script tester. You can see that BUY order opened on 2008.05.08 03:18 at price 204.80 (#1), and it was closed by 30 stop loss at 204.50 (#2) -- Highlited.
My question is:
Vertical Navy dashed line marked 03:18, when the order placed. And horizontal navy dashed line is the price when order opened.
1. My condition is to open an order when CurrentADX (LightSeaGreen line) is more than 25 level. But, in the image we can see that ADX line never crossed 25 level. How could this happened?
2. The highest price at that bar is 204.73. Why order opened at the 204.80?
Thanks in advance.
Regards,
bgrtz
I'm using iADX. And part of my code:
[script]
CurrentADX = iADX(NULL, 15, PeriodADX, PRICE_CLOSE, MODE_MAIN, 0);
PreviousADX = iADX(NULL, 15, PeriodADX, PRICE_CLOSE, MODE_MAIN, 1);
// BUY
if (CurrentADX > 25 && PreviousADX < 25) {
// other script
[/script]
Image attached is created after I run the script tester. You can see that BUY order opened on 2008.05.08 03:18 at price 204.80 (#1), and it was closed by 30 stop loss at 204.50 (#2) -- Highlited.
My question is:
Vertical Navy dashed line marked 03:18, when the order placed. And horizontal navy dashed line is the price when order opened.
1. My condition is to open an order when CurrentADX (LightSeaGreen line) is more than 25 level. But, in the image we can see that ADX line never crossed 25 level. How could this happened?
2. The highest price at that bar is 204.73. Why order opened at the 204.80?
Thanks in advance.
Regards,
bgrtz