Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by 3run. 09/19/19 09:42
Any chance of PBR materials with A8?
by Quad. 09/18/19 18:00
Sierra Chart Plugin
by AndrewAMD. 09/18/19 14:03
3d model editor
by karmacomposer. 09/18/19 13:18
Can MED export to FBX?
by karmacomposer. 09/18/19 13:07
I cannot get the A8 game engine to show anything
by karmacomposer. 09/18/19 12:38
Script, Start Trading Immediately
by jcl. 09/18/19 08:38
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
12 registered members (Ayumi, 3run, AndrewAMD, Quad, saulius, 20BN, kvm, MatPed, 3 invisible), 613 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Dark_Light, oxygenjoe, web20tpo, tarekhazem, Juanjo
18290 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to define Discrete Lot Sizes using Margin ? #477249
06/06/19 16:04
06/06/19 16:04
Joined: Oct 2018
Posts: 79
ags Offline OP
Junior Member
ags  Offline OP
Junior Member

Joined: Oct 2018
Posts: 79

anyone knows how to control Lot Sizes so that it only jumps in
discrete values when the script controls the Lot Sizes with Margin?

Problem: with Dukascopy the asset UKGilt (and some others) only accepts lot sizes of min 100 and multiples of 100, but not f.i. 120.

My script (on a portfolio of 20 elements) controls the Lots by Margin:

Margin = 0.1 * OptimalF * Capital * sqrt(1 + ProfitClosed/Capital);

and the enterLong (short is similar) is like this:

enterLong(0,-priceClose(0),StopL,0,myTrail,myTrailSlope,1, myTrailStep);

enterLong() would be the same.

Is there any elegant way to define the Lot Size, for this specific asset, in steps of 100 other than using a complex if(Asset == "UKGilt") Lots = (some formula containing Margin); ?

At the time being, i suspended this asset from the portfolio because i get some error messages like

UKGilt: can't open 1207@130 (because it is 1207 and not 1200 !)

Thank you for any idea.

Re: How to define Discrete Lot Sizes using Margin ? [Re: ags] #477355
06/18/19 14:21
06/18/19 14:21
Joined: Dec 2018
Posts: 18
Kaga Offline
Kaga  Offline

Joined: Dec 2018
Posts: 18
Lots = floor(notRoundedNumber/100)*100;

I mean, as far as I understand, your script will have to have the respective asset selected for the enterLong command to know which one to buy. So setting Lots before calling enterLong should do the trick, no?

Last edited by Kaga; 06/18/19 14:24.

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at)

Powered by UBB.threads™ PHP Forum Software 7.7.1