Thanks for sharing David.
Pipstubborn
Ghostrider
-
Maximilian
- Trader
- Posts: 150
- Joined: Sat Sep 06, 2014 2:43 pm
Ghostrider
First:
for the possible end of such a bad situation.
Second:
Did anybody get a BUY grid even in older versions? I didn´t find any. I already did a fresh Empty4 install but to no avail.
Cheers Maximilian
for the possible end of such a bad situation.
Second:
Did anybody get a BUY grid even in older versions? I didn´t find any. I already did a fresh Empty4 install but to no avail.
Cheers Maximilian
-
Maximilian
- Trader
- Posts: 150
- Joined: Sat Sep 06, 2014 2:43 pm
Ghostrider
Hi all,
I eventually found the code preventing Ghostie to send a buy grid with my setup.
Took me a few days. Sounds obvious if you know how to code and what to look for but well...
Ghostie has a safety feature in the SendBuyGrid function which checks if the takeprofit is higher as the actual price of the stop order, if not it stops trying to send a grid. If you, like me hadn´t set a take profit in first place, no global variable is set as take profit, therefore the BuyGrid function sets the take to 0 and voila here we go: no buy grid.
The same check doesn´t matter in the sellgrid function because well, the price could always go towards zero.
Anyhow I am happy for myself to solve this one, because it was driving me nuts to see Ghostie open sellgrids but not buygrids.
Cheers Maximilian
I eventually found the code preventing Ghostie to send a buy grid with my setup.
Ghostie has a safety feature in the SendBuyGrid function which checks if the takeprofit is higher as the actual price of the stop order, if not it stops trying to send a grid. If you, like me hadn´t set a take profit in first place, no global variable is set as take profit, therefore the BuyGrid function sets the take to 0 and voila here we go: no buy grid.
The same check doesn´t matter in the sellgrid function because well, the price could always go towards zero.
Anyhow I am happy for myself to solve this one, because it was driving me nuts to see Ghostie open sellgrids but not buygrids.
Cheers Maximilian
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Ghostrider
Wonderful stuff Maximilian and thanks again.Maximilian » Mon Dec 14, 2020 1:56 pm wrote:Hi all,
I eventually found the code preventing Ghostie to send a buy grid with my setup.![]()
![]()
![]()
Took me a few days. Sounds obvious if you know how to code and what to look for but well...
Ghostie has a safety feature in the SendBuyGrid function which checks if the takeprofit is higher as the actual price of the stop order, if not it stops trying to send a grid. If you, like me hadn´t set a take profit in first place, no global variable is set as take profit, therefore the BuyGrid function sets the take to 0 and voila here we go: no buy grid.
The same check doesn´t matter in the sellgrid function because well, the price could always go towards zero.
Anyhow I am happy for myself to solve this one, because it was driving me nuts to see Ghostie open sellgrids but not buygrids.
Cheers Maximilian
This is one of those, "Thingies I did not think of," thingy. I did not think to cater for people sending a grid without a take profit. I will include the fix in the next release.
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.
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.
-
Maximilian
- Trader
- Posts: 150
- Joined: Sat Sep 06, 2014 2:43 pm
Ghostrider
Hey Steve,
I think in the CandleOK function there a parenthesis is missing:
double midPoint = (iHigh(Symbol(),LowerZzTimeFrame, 1) + iLow(Symbol(),LowerZzTimeFrame, 1) / 2);
should be
double midPoint = ((iHigh(Symbol(),LowerZzTimeFrame, 1) + iLow(Symbol(),LowerZzTimeFrame, 1)) / 2);
because of dividing before adding rule (don´t know the English term)
Cheers,
Max
I think in the CandleOK function there a parenthesis is missing:
double midPoint = (iHigh(Symbol(),LowerZzTimeFrame, 1) + iLow(Symbol(),LowerZzTimeFrame, 1) / 2);
should be
double midPoint = ((iHigh(Symbol(),LowerZzTimeFrame, 1) + iLow(Symbol(),LowerZzTimeFrame, 1)) / 2);
because of dividing before adding rule (don´t know the English term)
Cheers,
Max
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Ghostrider
Thanks again Max. Hugely appreciated.Maximilian » Tue Dec 15, 2020 1:49 pm wrote:Hey Steve,
I think in the CandleOK function there a parenthesis is missing:
double midPoint = (iHigh(Symbol(),LowerZzTimeFrame, 1) + iLow(Symbol(),LowerZzTimeFrame, 1) / 2);
should be
double midPoint = ((iHigh(Symbol(),LowerZzTimeFrame, 1) + iLow(Symbol(),LowerZzTimeFrame, 1)) / 2);
because of dividing before adding rule (don´t know the English term)
Cheers,
Max
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.
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.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Ghostrider
V 1e is in post 1, with the edits pointed out by Max.
A DIY is simple.
Do a search for:
if (take < price)
Add an extra conditional so that the snippet looks like this:
Then do a search for:
double midPoint = (iHigh(Symbol(),LowerZzTimeFrame, 1) + iLow(Symbol(),LowerZzTimeFrame, 1) / 2);
Add the extra brackets:
double midPoint = ((iHigh(Symbol(),LowerZzTimeFrame, 1) + iLow(Symbol(),LowerZzTimeFrame, 1)) / 2);

A DIY is simple.
Do a search for:
if (take < price)
Add an extra conditional so that the snippet looks like this:
Code: Select all
//And another
if (!CloseEnough(take, 0) )
if (take < price)
return;
double midPoint = (iHigh(Symbol(),LowerZzTimeFrame, 1) + iLow(Symbol(),LowerZzTimeFrame, 1) / 2);
Add the extra brackets:
double midPoint = ((iHigh(Symbol(),LowerZzTimeFrame, 1) + iLow(Symbol(),LowerZzTimeFrame, 1)) / 2);
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.
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.
- tomele
- Administrator
- Posts: 1208
- Joined: Tue May 17, 2016 3:40 pm
- Location: Germany, Forest of Odes, Defending the Limes
Ghostrider
Hi Max.Maximilian » 15 Dec 2020, 15:49 wrote:... because of dividing before adding rule (don´t know the English term)
You are absolutely right. One common english term is "operator precedence". A general summary can be found here: https://en.wikipedia.org/wiki/Order_of_operations. For MQ4, it is fully explained here: https://docs.mql4.com/basis/operations/rules.
Stay well and safe.
Happy pippin, Thomas 
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
-
Maximilian
- Trader
- Posts: 150
- Joined: Sat Sep 06, 2014 2:43 pm
Ghostrider
Thanks for the links, Thomas,
Max
Max
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Ghostrider
Just making sure you have seen folks, that Thomas has posted TDesk 7.3 along with a full user guide. Usual place: viewtopic.php?p=163522#p163522
Thanks Thomas.

Thanks Thomas.

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.
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.