Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 722 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
OptimalF, Capital, Margin, enterLong(), Skipped (Amount = 0) #487735
08/22/23 13:38
08/22/23 13:38
Joined: Jan 2021
Posts: 17
J
jari Offline OP
Newbie
jari  Offline OP
Newbie
J

Joined: Jan 2021
Posts: 17
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.
Re: OptimalF, Capital, Margin, enterLong(), Skipped (Amount = 0) [Re: jari] #487749
09/02/23 08:04
09/02/23 08:04
Joined: Jan 2021
Posts: 17
J
jari Offline OP
Newbie
jari  Offline OP
Newbie
J

Joined: Jan 2021
Posts: 17
Looking at more log outputs,
looks like during the early period of testing, OptimalF is 0.0 and then became 0.103.

Test period starts from 13-06-12 (12th of june 2013)
[118304: Wed 13-06-12 21:30] (1611.50)
OptimalF 0.000000

Lookback period doesn't seem to affect optimalF, as expected
End of lookback period
[118384: Fri 13-06-14 14:30] (1636.20)
OptimalF 0.000000

OptimalF becomes non-zero only on the 24th of june 2013
[118666: Mon 13-06-24 19:30] (1577.40)
OptimalF 0.103000

I tried to look through the manual, but there is no indication that OptimalF changes over time.
Am I missing something?

Thank you

Re: OptimalF, Capital, Margin, enterLong(), Skipped (Amount = 0) [Re: jari] #487757
09/07/23 09:23
09/07/23 09:23
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, the lookback period. It's not for trading.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1