stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Ghostrider
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5942
Page 11 of 12
Author:  Pipstubborn [ Thu Dec 10, 2020 1:10 pm ]
Post subject:  Ghostrider

Thanks for sharing David.

Pipstubborn
Author:  Maximilian [ Fri Dec 11, 2020 7:57 pm ]
Post subject:  Ghostrider

First:
:yahoo: :yahoo: :yahoo: :yahoo: :yahoo: :yahoo: :yahoo:
for the possible end of such a bad situation.
:party: :party: :party: :party: :party: :party: :party:
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
Author:  Maximilian [ Mon Dec 14, 2020 1:56 pm ]
Post subject:  Ghostrider

Hi all,
I eventually found the code preventing Ghostie to send a buy grid with my setup. :yahoo: :yahoo: :yahoo: :yahoo: 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
Author:  SteveHopwood [ Mon Dec 14, 2020 7:36 pm ]
Post subject:  Ghostrider

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. :yahoo: :yahoo: :yahoo: :yahoo: 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
Wonderful stuff Maximilian and thanks again. :clap: :clap: :clap:

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.

:xm: :rocket:
Author:  Maximilian [ Tue Dec 15, 2020 1:49 pm ]
Post subject:  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
Author:  SteveHopwood [ Tue Dec 15, 2020 3:36 pm ]
Post subject:  Ghostrider

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
Thanks again Max. Hugely appreciated. :clap: :clap: :clap: Only someone with a better grasp of maths than I can confirm this but I will add the extra bracket anyway. I am a little surprised I did not do so in the first place - I bracket pretty much everything. :lol:

:xm: :rocket:
Author:  SteveHopwood [ Wed Dec 16, 2020 11:24 am ]
Post subject:  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:

Code: Select all

      //And another
      if (!CloseEnough(take, 0) )
         if (take < price)
            return;
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);

:xm: :rocket:
Author:  tomele [ Thu Dec 17, 2020 12:43 am ]
Post subject:  Ghostrider

Maximilian » 15 Dec 2020, 15:49 wrote:... because of dividing before adding rule (don´t know the English term)
Hi Max.

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.
Author:  Maximilian [ Thu Dec 17, 2020 7:27 am ]
Post subject:  Ghostrider

Thanks for the links, Thomas,

Max
Author:  SteveHopwood [ Thu Dec 31, 2020 7:52 pm ]
Post subject:  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. :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :party: :party: :party: :party: :party: :party: :party: :party: :party: :party: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!: :!!:
All times are UTC Page 11 of 12