Seems to be working fine now with the following adjustments:
Buy logics:
MA (1) Previous < MA (2) Previous
AND MA (1) Current > MA (2) Current
Volume < 5
Sell logics:
MA (1) Previous > MA (2) Previous
AND MA (1) Current < MA (2) Current
Volume < 5
A big thanks to SCORPION for creating ZEROCODE !
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
I would like to create a simple expert advisor using ZeroCode that opens and closes orders at the cross of two moving averages. The moving averages I have chosen are EMAs 2 & 20.
I believe I have written the correct buy and sell logics using ZeroCode:
Buy logics:
MA (1) Previous < MA (2) Previous
AND MA (1) Current > MA (2) Current
Vol < 5
Sell logics:
MA (1) Previous > MA (2) Previous
AND MA (1) Current < MA (2) Current
Vol < 5
It is my understanding that 'Vol < 5' means the expert can open a new trade within the current candle. However the problem seems to be with this logic because when I compile my newly created advisor into my experts folder, a .txt file is created and when opened it states:
42;7;1;25;variable not defined - token "Vol"
Here is the system in coded form:
If anyone can help it would be much appreciated.