Gertje: a hedged grid trader

Post Reply
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Gertje: a hedged grid trader

Post by SteveHopwood »

Got it, I think. Fix in post 1 - at least I think it is a fix.

Coders, given that the lot size is now a changeable thingy, then Lot needs te remain permanent. I declared SendLot as a program-wide variable to hold the value of the adapted lot size.

This snippet holds the key:

Code: Select all

void CalculateLotsizeAndProfitTarget()
{
   //Auto lot size, calculated as LotsPerThousandOfBalance per $1000
   SendLot = Lot;
   if (LotsPerThousandOfBalance > 0)
   {
      //Code for rounding down the account balance to bare thousands profided by Garyfritz. Many thanks Gary.
      double BaseMag = MathPow(10, MathFloor(MathLog(AccountBalance()) / MathLog(10))); // 4376.59 -> 1000
      double RoundDown = MathFloor(AccountBalance() / BaseMag) * BaseMag;
      Lot = (RoundDown * 0.1) / 1000;      
   }//if (LotsPerThousandOfBalance > 0)

   //Adaptive take profit
   if (CashProfitPerLot > 0)
   {
      CashProfitTarget = NormalizeDouble(Lot * CashProfitPerLot, 0);
   }//if (CashProfitPerLot > 0)
   
   
   //Users can opt for incrementing the lotsize with each successive trade in the grid
   if (OpenTrades > 0) IncrementLot();

   //Lotsize idiot check
   double MinLot = MarketInfo(Symbol(), MODE_MINLOT);
   double MaxLot = MarketInfo(Symbol(), MODE_MAXLOT);
   if (SendLot < MinLot) Lot = MinLot;
   if (SendLot > MaxLot) Lot = MaxLot;
   

}//End void CalculateLotsizeAndProfitTarget()
The problem is the line:

Code: Select all

Lot = (RoundDown * 0.1) / 1000;      
which leaves SendLot at the value of Lot as it was on load up. This actually needs to be:

Code: Select all

SendLot = (RoundDown * 0.1) / 1000;      
So, non-coders download the fix in post 1. Coders, you know how to make the change.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Gertje: a hedged grid trader

Post by SteveHopwood »

Coders, in that code snippet I posted, there are a few more changes to make that I forgot to mention - look at:

Code: Select all

   //Lotsize idiot check
   double MinLot = MarketInfo(Symbol(), MODE_MINLOT);
   double MaxLot = MarketInfo(Symbol(), MODE_MAXLOT);
   if (SendLot < MinLot) Lot = MinLot;
   if (SendLot > MaxLot) Lot = MaxLot;
Bit rich coming from me. Hey ho.

Also, the max pairs trading thingy appears not to work. I will sort that one out tomorrow.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Gertje: a hedged grid trader

Post by SteveHopwood »

Oh, Strain a Bicep Playing Chess. I found the reason for the max pairs thingy not working the instant I went looking for it.

Usual thingy. Carefully coded al the prelim stuff - declared the variables, added the chart feed back etc. This can take ages. Then forgot to add the actual filter to the trade decision code.

Can't you guys find a forum to go to where the PCA has a firing brain cell?

Fix in post 1. If it actually fixes anything. Given my record today, I doubt it.

:oops:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
nubika
Trader
Posts: 80
Joined: Tue Dec 06, 2011 9:52 pm
Location: Sydney, Hills District

Re: Gertje: a hedged grid trader

Post by nubika »

TehCount wrote:NOTE: These were started with the first version of this EA. The set files may or may not work with the latest version but you can see the effective settings. Trend detection (RSI) was not used on these.

UPDATE: Both killed. Old version of EA and no longer relevant..

Image
gertje.a.set
Image
gertje.b.set

I do not understand how did you manage to get the accounts killed.

I need to look at your set files.

Both of my accounts and the LIVE account as well, made huge gains this morning because of the weekend gap. The EA performed absolutely perfectly. Took all the profits and reopened the grid instantly.

My AUDUSD account now up by 24% and the GBPJPY account is up by 26%

I am also using the original EA and performs like a miracle up until now.

I started a new setup with the latest version, but only looking for the feature which protects the account in ranging conditions and looks for a breakeven amount. Maybe this will never happen, so I might not be able to see if it actually works as well as it is intended.

Frank
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Gertje: a hedged grid trader

Post by SteveHopwood »

Latest update in post 1. Some bugs surfaced in the money management code this morning, so the update is essential if you are using mm.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
blazko
Trader
Posts: 86
Joined: Thu Dec 01, 2011 10:57 am

Re: Gertje: a hedged grid trader

Post by blazko »

nubika wrote: Both of my accounts and the LIVE account as well, made huge gains this morning because of the weekend gap. The EA performed absolutely perfectly. Took all the profits and reopened the grid instantly.

My AUDUSD account now up by 24% and the GBPJPY account is up by 26%

I am also using the original EA and performs like a miracle up until now.

I started a new setup with the latest version, but only looking for the feature which protects the account in ranging conditions and looks for a breakeven amount. Maybe this will never happen, so I might not be able to see if it actually works as well as it is intended.

Frank
Frank, do you mind posting your current set with pairs/tf info?
My work proxy is loading forum posts for ages and i cant easly search for it. Thank you.
cheers
nubika
Trader
Posts: 80
Joined: Tue Dec 06, 2011 9:52 pm
Location: Sydney, Hills District

Re: Gertje: a hedged grid trader

Post by nubika »

blazko wrote:
nubika wrote: Both of my accounts and the LIVE account as well, made huge gains this morning because of the weekend gap. The EA performed absolutely perfectly. Took all the profits and reopened the grid instantly.

My AUDUSD account now up by 24% and the GBPJPY account is up by 26%

I am also using the original EA and performs like a miracle up until now.

I started a new setup with the latest version, but only looking for the feature which protects the account in ranging conditions and looks for a breakeven amount. Maybe this will never happen, so I might not be able to see if it actually works as well as it is intended.

Frank
Frank, do you mind posting your current set with pairs/tf info?
My work proxy is loading forum posts for ages and i cant easly search for it. Thank you.
Blazej,

This is what I am using.

TF is irrelevant, but I use TF 30 min for better visual tracking.

These are still on the first original Gartje EA.

AUDUSD:

Account size: $2000 Current balance as I write this $2504 started on the 19th of March

Lot size: 0.2
Cash profit target: $19
Pips between trades: 25
No of trades : 30
RsiTdApplied Price: 0 The rest is default

Only one pair per account.

GBPJPY:

Account size: $2000 Current balance $2666.20 Started on the 28th of March

Lot size: 0.3
Cash profit target : $43
Pips between trades : 27
No of trades: 30
RsiTdApplied Price: 0 The rest is default

I am also running from today additional accounts with different settings using the latest version of the EA.
EURAUD, EURJPY and AUDJPY

Will report on those later.

Frank
User avatar
blazko
Trader
Posts: 86
Joined: Thu Dec 01, 2011 10:57 am

Re: Gertje: a hedged grid trader

Post by blazko »

Thanks a lot Frank.
I need do wrap my head around chosing profit targets and pips between trades values.
cheers
harry45
Trader
Posts: 158
Joined: Fri Nov 18, 2011 11:36 am
Location: Russia,St.Petersburg

Re: Gertje: a hedged grid trader

Post by harry45 »

nubika wrote:
blazko wrote:
nubika wrote: Both of my accounts and the LIVE account as well, made huge gains this morning because of the weekend gap. The EA performed absolutely perfectly. Took all the profits and reopened the grid instantly.

My AUDUSD account now up by 24% and the GBPJPY account is up by 26%

I am also using the original EA and performs like a miracle up until now.

I started a new setup with the latest version, but only looking for the feature which protects the account in ranging conditions and looks for a breakeven amount. Maybe this will never happen, so I might not be able to see if it actually works as well as it is intended.

Frank
Frank, do you mind posting your current set with pairs/tf info?
My work proxy is loading forum posts for ages and i cant easly search for it. Thank you.
Blazej,

This is what I am using.

TF is irrelevant, but I use TF 30 min for better visual tracking.

These are still on the first original Gartje EA.

AUDUSD:

Account size: $2000 Current balance as I write this $2504 started on the 19th of March

Lot size: 0.2
Cash profit target: $19
Pips between trades: 25
No of trades : 30
RsiTdApplied Price: 0 The rest is default

Only one pair per account.

GBPJPY:

Account size: $2000 Current balance $2666.20 Started on the 28th of March

Lot size: 0.3
Cash profit target : $43
Pips between trades : 27
No of trades: 30
RsiTdApplied Price: 0 The rest is default

I am also running from today additional accounts with different settings using the latest version of the EA.
EURAUD, EURJPY and AUDJPY

Will report on those later.

Frank

Frank, You mean RSI TF 1440,Per=20,applied price=0.Am I right?
Regards
nubika
Trader
Posts: 80
Joined: Tue Dec 06, 2011 9:52 pm
Location: Sydney, Hills District

Re: Gertje: a hedged grid trader

Post by nubika »

Frank, You mean RSI TF 1440,Per=20,applied price=0.Am I right?
Regards[/quote]


Harry

No, this is what I set up. In other words, I disabled the RSI filter.

RSI TF 1440,
Per=0,
applied price=0

Frank
Post Reply

Return to “Automated trading systems”