- Joined
- 21 May 2008
- Posts
- 664
- Reactions
- 14
Have used the back test and have a dozen different AFl code files I've written but today it's "gone mad" after I wrote a simple one for shorting.
I now put in the equity e.g. 1000 but it will buy up to a million $ worth of units. Same for long or short. Any idea why? Is my AB corrupt? I am thinking a reinstall may fix it.
Code is simple e.g. for long:
Buy = (EMA( Close , 10 ) > EMA( Close , 30 ));
Sell = (EMA( Close, 30) > EMA ( Close, 10 ));
Pic is from the trades $1,000 equity Buy/Sell on open with delay of 1. So you can see I have "bought" 340K of stock with 1K. And there is no margin used.
Any advice would be appreciated.
Tks
I now put in the equity e.g. 1000 but it will buy up to a million $ worth of units. Same for long or short. Any idea why? Is my AB corrupt? I am thinking a reinstall may fix it.
Code is simple e.g. for long:
Buy = (EMA( Close , 10 ) > EMA( Close , 30 ));
Sell = (EMA( Close, 30) > EMA ( Close, 10 ));
Pic is from the trades $1,000 equity Buy/Sell on open with delay of 1. So you can see I have "bought" 340K of stock with 1K. And there is no margin used.
Any advice would be appreciated.
Tks