Hi zorro masters,

I have the following code running on Oanda SPX500,
which ran ok on Train and Test,
but when I ran it on Trade (live account),
I got:
(SPX500:<algo name>:L) Skipped (Amount = 0)

Script:
Code
Margin = 0.5*OptimalF*Capital;
enterLong();

AssetsOanda:
Code
Name,Price,Spread,RollLong,RollShort,PIP,PIPCost,MarginCost,Market,LotAmount,Commission,Symbol
SPX500,2838,0.5,0.0645,-0.1439,1,0.1,-1,CST:1800-1700,0.1,0,SPX500/USD

Accounts:
Code
Name,Broker,Account,User,Pass,Assets,CCY,Real,NFA,Plugin
REAL Oanda Account,Oanda,0,<user number>,<api key>,AssetsOanda,<account currency>,1,0,Oanda.dll

When i later on modified the script to output the following (because the script is for a day-of-week trade), the test output is:
margin 25.750000, optimalf 0.103000, capital 500.000000

Is it just a case of the margin being too small to execute?
But if it is, why does the test register non-zero trades....?

From test:
margin 25.750000, optimalf 0.103000, capital 500.000000
[SPX500:<algo name>:L66687] Long 16@1577.40 Risk 428 at 19:30:00

Thank youu

-------------

Aha! Hmmmmmm might be because the test was from 2013 where SPX500 was 1500+ instead of today's 4300+ where the margin requirement for the smallest possible trade is bigger than during test.
>> debunked. Set StartDate = 20230101; tested ok
>> margin 25.750000, optimalf 0.103000, capital 500.000000
>> [SPX500:<algo name>:L44245] Long 6@4139.68 Risk 421 at 19:30:00
so, still looking for why real trade skips

Last edited by jari; 08/22/23 13:59.