Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 10/15/26 08:28
Alternative to Stooq for Zorro S
by Petra. 10/14/26 07:04
Stooq now requires an API key
by cwford. 10/08/26 23:27
Purchase A8 full licence version
by jcl. 10/05/26 12:12
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (VoroneTZ), 11,269 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Limiting Trades Per Day #417155
02/09/13 11:44
02/09/13 11:44
Joined: Sep 2012
Posts: 99
T
TankWolf Offline OP
Junior Member
TankWolf  Offline OP
Junior Member
T

Joined: Sep 2012
Posts: 99
Im wondering if someone might be able to help me out with a problem I cant seem to solve. In one of my scripts I want to limit the amount of trades per day. What Im trying to achieve is to only allow one long trade and one short trade per day if certain entry requirements occur. I can obviously restrict opening trades by using NumOpenLong & NumOpenShort but this doesnt achieve what I desire Im not sure how I only allow one trade in both directions to be triggered each day.

I was thinking it would work something like this but doesnt seem to work as I wanted:

Quote:

static int ShortTradesPerDay = 0;
static int LongTradesPerDay = 0;
if(day(0) != day(1)) { //New Day
ShortTradesPerDay = 1; //Reset ShortTrades allowed back to 1 at new day?
LongTradesPerDay = 1; //Reset LongTrades allowed back to 1 at new day?
}
if(Condition A > Condition B && LongTradesPerDay == 1) {
enterLong();
LongTradesPerDay -= 1;
}
else if(Condition B > Condition A && ShortTradesPerDay == 1) {
enterShort();
ShortTradesPerDay -=1;

Re: Limiting Trades Per Day [Re: TankWolf] #417175
02/09/13 17:02
02/09/13 17:02
Joined: Apr 2008
Posts: 603
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 603
Austria
I would also do it this way, what does not work?


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

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

Powered by UBB.threads™ PHP Forum Software 7.7.1