You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hello,
I have programmed some indicators, but haven't used the great feature of metatrader regarding EA's including the strategy tester.
To generate an EA for the strategy tester, I copied the code from my indicator to the EA, since the EA's generally don't seem to be very different from
the indicator structure - at least looking at the program layout.
Now my custom indicator generates(in the code) a trigger signal in the form of (as an example)
if(Condition) ) {PlaySound("BUY.wav")} etc.
If I replace this code in the newly formed EA by a simple command like as the buy-condition to open a position:
OrderSend(Symbol(),OP_BUY,1,Ask,2,NULL,NULL) no orders are triggered(positions opened), no matter if using the EA live or with the stragegy tester.
As a sidemark: if one creates a simple(empty, predefined) EA and places the command OrderSend(Symbol(),OP_BUY,1,Ask,2,NULL,NULL) between
Start() and return() orders are triggered(positions opened).
So what's my (probably simple) basic mistake with the use of an EA?
thanks in advance