The back-tester creates arrows when it places an order by default, is this not enough for you? Your code above is not enough for someone else to debug. Submit the entire code. Check if the order is being selected correctly. Use Print or Alert in back-tester to verify the value of ticket or returned values from order select. Give different names to "Arrow" or you'll have only one object on chat. Example "Arrow"+timeCurrent.
Can someone give me some help, thanks.
The problem is when I back test it does not place any arrows.
I have 85 trades place but no arrows?
I've attached the code but it is not my code, it was some code I found on the internet and I've been playing with it to learn how it works.
The problem is when I back test it does not place any arrows.
What kind of arrow do you want ? https://docs.mql4.com/constants/arrows or maybe one of these ? https://docs.mql4.com/constants/wingdings
PAG24:
OrderSelect(tiket,SELECT_BY_TICKET);
ObjectCreate("Arrow", OBJ_ARROW, 0,OrderOpenTime(), OrderClosePrice( ) );
I can use the same line in a script and it will draw an arrow, if I use it in an EA and do some back testing it does not draw anything.
My goal is to have my EA leave markers where it places the orders, so when I do back testing there is a visual indication of where the trade took place.
- You code places the arrow the same place the tester does (+/- SPREAD,) perhaps that is why you don't see it.
- Once you create the object further create calls will fail and the arrow won't move.
- You don't define the type of arrow as Raptor points out.
Ok so if I add in a value which increments, and I changed it to a V line, so now the line comes up but it still only places it once at the very start.
How do I increment in correctly?
ObjectCreate("Arrow2"+gh, OBJ_VLINE, 0,OrderOpenTime(), OrderClosePrice());
Now what do you mean by Raptor points out?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am playing around with MQL4 and have created a basic script, here is a snippet.
The issue is just the ObjectCreate.
int tiket=OrderSend(Symbol(), OP_BUY, Lotsi,Ask, 0, 0,0, 0);
OrderModify(tiket,Ask,Ask - 100*Point,Ask + 250 * Point,0);
OrderSelect(tiket,SELECT_BY_TICKET);
ObjectCreate("Arrow", OBJ_ARROW, 0,OrderOpenTime(), OrderClosePrice( ) );
I can use the same line in a script and it will draw an arrow, if I use it in an EA and do some back testing it does not draw anything.
My goal is to have my EA leave markers where it places the orders, so when I do back testing there is a visual indication of where the trade took place.
Can someone give me some help, thanks.