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

Gday Mark 2
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=917
Page 10 of 30
Author:  gaheitman [ Mon Nov 05, 2012 11:44 am ]
Post subject:  Re: Gday Mark 2

SteveHopwood wrote:Shelly, I cannot see any reason for those strange part-closures. The code that calls the part-closure function is enclosed within a conditional that demands that the trade be in profit before the part=closure function is called. My live account did not take these trades because I will not sell the high-swap pairs. My demo did and has not replicated the problem.

So, no idea what caused it. Maybe the other coders can see something wrong? All the management features are called from within CountOpenTrades().

:D
Steve,

In CountOpenTrades(), the code:

Code: Select all

    if (OrderType() == OP_SELL && OrderStopLoss() <= OrderOpenPrice() && OrderLots() == Lot)
            {
               PartCloseThisTrade();
            }//if (OrderType() == OP_SELL)
would seem to be the culprit. The only test to get here is that OrderProfit() > 0. Since there is no StopLoss, OrderStopLoss() will be <= OrderOpenPrice(), giving us the impression that we have either hit BE or moved our SL down....

There also seems to be an issue a bit further down.

Code: Select all

            if (OrderType() == OP_SELL && OrderStopLoss() >= OrderOpenPrice() - (BreakEvenProfit / factor) - JumpingStopPips && OrderLots() > PartLot)
            {
               PartCloseThisTrade();
            }//if (OrderType() == OP_BUY && OrderStopLoss() >= OrderOpenPrice() 
Don't you want it to be OrderStopLoss() <= OrderOpenPrice()... ?

Also, I can't tell if jumping stop was set or not, but I believe if it is not then this code:

Code: Select all

            if (pp >= (JumpingStopPips * 2) && OrderLots() > PartLot) PartCloseThisTrade();
will incorrectly call PartCloseThisTrade().

George
Author:  garyfritz [ Mon Nov 05, 2012 3:12 pm ]
Post subject:  Re: Gday Mark 2

cosmo wrote:I have also been running G’day on another account using an alternative to 7.2.2. Stochastic, the De Mark Tendline, using the DMT I would not have taken any of the losers and would be well ahead, it is also less subjective and easy to follow, buy/sell on cross of trendline on the open of a new daily bar, see rules below.
Stochastic is already pretty objective!

cosmo, you say you're "running G'day using the DMT." The DMT technique described in the doc file is nothing like Gday. It opens on a break of a trendline, and closes at a price projection. Gday opens at a specified Stochastic behavior (in & out of OB/OS) and closes at specified pip targets. So how are you applying DMT to Gday?
Author:  MrLong [ Mon Nov 05, 2012 5:05 pm ]
Post subject:  Re: Gday Mark 2

Hello Traders,

Gday system, seems to like M15 TF.
Author:  SteveHopwood [ Mon Nov 05, 2012 5:22 pm ]
Post subject:  Re: Gday Mark 2

gaheitman wrote:
SteveHopwood wrote:Shelly, I cannot see any reason for those strange part-closures. The code that calls the part-closure function is enclosed within a conditional that demands that the trade be in profit before the part=closure function is called. My live account did not take these trades because I will not sell the high-swap pairs. My demo did and has not replicated the problem.

So, no idea what caused it. Maybe the other coders can see something wrong? All the management features are called from within CountOpenTrades().

:D
Steve,

In CountOpenTrades(), the code:

Code: Select all

    if (OrderType() == OP_SELL && OrderStopLoss() <= OrderOpenPrice() && OrderLots() == Lot)
            {
               PartCloseThisTrade();
            }//if (OrderType() == OP_SELL)
would seem to be the culprit. The only test to get here is that OrderProfit() > 0. Since there is no StopLoss, OrderStopLoss() will be <= OrderOpenPrice(), giving us the impression that we have either hit BE or moved our SL down....

There also seems to be an issue a bit further down.

Code: Select all

            if (OrderType() == OP_SELL && OrderStopLoss() >= OrderOpenPrice() - (BreakEvenProfit / factor) - JumpingStopPips && OrderLots() > PartLot)
            {
               PartCloseThisTrade();
            }//if (OrderType() == OP_BUY && OrderStopLoss() >= OrderOpenPrice() 
Don't you want it to be OrderStopLoss() <= OrderOpenPrice()... ?

Also, I can't tell if jumping stop was set or not, but I believe if it is not then this code:

Code: Select all

            if (pp >= (JumpingStopPips * 2) && OrderLots() > PartLot) PartCloseThisTrade();
will incorrectly call PartCloseThisTrade().

George
A couple of really helpful spots in their George. Thanks. I am always forgetting to check that sells actually have a stop loss. :oops:

I still do not see how the code reached that point as the trade has to be in profit first and Shelley's were not. I noticed in Shelley's pic that Gday had made attempts to part-close and that this generated an invalid ticket error.

Just in case this is yet another example of Crapql4 not doing what it says in the documentation and was looking at a closed and profitable trade in the History list, I have added MODE_TRADES to the OrderSelect command.

Coders, you might want to add if (OrderCloseTime() > 0) continue; as well. I will do this in the next release.

Note to newbie coders: I am learning not to trust the Crapql4 documentation and to declare variables explicitly. Do not rely on the 'default' values described in the documentation. The proper coders here tell me this is just basic good practise anyhow.

Version 1e is in post 1, with the fixes for the bloops George picked up on. This is an essential download.

Also, George sent me a very neat chart history check that leaves us with the best of all possible worlds. The code is right at the top of start() and the two functions you need are immediately above start. You want to pinch and edit this and use it in your own shells. I am about to add it to mine.

Thanks again George. Invaluable help.

:D
Author:  SteveHopwood [ Mon Nov 05, 2012 5:31 pm ]
Post subject:  Re: Gday Mark 2

I am loading the update onto my accounts and notice that OnlyTradePositiveSwap is enabled by default. This will cut out a lot of trades, so I recommend you change it to 'false'.

:D
Author:  gaheitman [ Mon Nov 05, 2012 6:05 pm ]
Post subject:  Re: Gday Mark 2

SteveHopwood wrote: A couple of really helpful spots in their George. Thanks. I am always forgetting to check that sells actually have a stop loss. :oops:

I still do not see how the code reached that point as the trade has to be in profit first and Shelley's were not. I noticed in Shelley's pic that Gday had made attempts to part-close and that this generated an invalid ticket error.
I think the trade was just barely in profit. According to the log, it closed the sell that was opened at 1.03390 at 1.03382. Well, that's what it tried to do, it slipped a bit.

I think the partial close that failed was called within the came call to CountOpenTrades(). That's why it had the invalid ticket number. When it partially closed the first trade, the remaining trade got a new number, so it couldn't do another partial close. That's what led me to wonder if she had JumpingStops off.

George
Author:  SteveHopwood [ Tue Nov 06, 2012 12:28 am ]
Post subject:  Re: Gday Mark 2

I just had a new D1 candle open on my live account. G took buys on audnzd and eurgbp.

What the Hell am I doing selling nzd. That positive swap on the pair better be good. :lol:

What the Hell am I doing trading the nzd at all? The spread is criminal.

Note to myself: remove anything to do with nzd at the earliest possible opportunity.

:D
Author:  fxozgirl [ Tue Nov 06, 2012 1:18 am ]
Post subject:  Re: Gday Mark 2

Thanks for the fix George & the update Steve :D

I missed getting it on for the new candle today, but v1c took nzdjpy
Author:  MrLong [ Tue Nov 06, 2012 7:29 am ]
Post subject:  Re: Gday Mark 2

Morning Traders,

Here is a fresh M15 basket started at GMT 20:30 last night, hopfully I will upload the EA later today, you will have the option to trade any timeframe.

Best Regards
Andy
Author:  fxozgirl [ Tue Nov 06, 2012 8:50 am ]
Post subject:  Re: Gday Mark 2

MrLong wrote:Morning Traders,

Here is a fresh M15 basket started at GMT 20:30 last night, hopfully I will upload the EA later today, you will have the option to trade any timeframe.

Best Regards
Andy
Very nice Andy...looking forward to your EA :D

Thanks for sharing!
All times are UTC Page 10 of 30