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

Bob and Shelley Again
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=2759
Page 12 of 120
Author:  fxdaytrader [ Wed Aug 07, 2013 8:30 pm ]
Post subject:  Re: Bob and Shelley Again

I wonder about the following condition for re-entry trades:

if (OpenTrades > 0) SendLong = false;//5
and
if (OpenTrades > 0) SendShort = false;//5

Assuming we got the mainentry already we had an open trade - so opentrades would be at least 1 ...
Or do I overlook something? :roll:

Hm, I think the MaxTradesAllowed variable could be useful to limit the opentrades count also in general (or more sophisticated, e.g. maxopenmaintrades=xyz, maxreentrytrades=abc, maxstacktrades=ghi)?

For the re-entry-trades (+ stacktrades) it imho could make sense to check if the previous trades are in profit (may be to be choosen by user if to activate, AddToProfitTradesOnly=true ..).
Author:  SteveHopwood [ Wed Aug 07, 2013 8:44 pm ]
Post subject:  Re: Bob and Shelley Again

fxdaytrader wrote:I wonder about the following condition for re-entry trades:

if (OpenTrades > 0) SendLong = false;//5
and
if (OpenTrades > 0) SendShort = false;//5

Assuming we got the mainentry already we had an open trade - so opentrades would be at least 1 ...
Or do I overlook something? :roll:
A re-entry trade is a new trade following a retrace. A Main trade is a Main trade. There can only be one of either a Main or a Re-entry trade - we do not need both. Therefore, if there is already a trade open, we do not open a second one following a Re-entry setup. Yet.
Hm, I think the MaxTradesAllowed variable could be useful to limit the opentrades count also in general (or more sophisticated, e.g. maxopenmaintrades=xyz, maxreentrytrades=abc, maxstacktrades=ghi)?

For the re-entry-trades (+ stacktrades) it imho could make sense to check if the previous trades are in profit (may be to be choosen by user if to activate, AddToProfitTradesOnly=true ..).
Don't need it. The first trade is either a Main or a Re-entry trade. There are not one of each. Any successive trade is a Stack. It the user is thick enough to allow stack trades before the previous one is at breakeven, that is his/her fault. There is only so much idiot-checking that I am prepared to do. This is not an EA for Dummies. :lol:



:D
Author:  fxozgirl [ Wed Aug 07, 2013 8:55 pm ]
Post subject:  Re: Bob and Shelley Again

SteveHopwood wrote:V 1g is in post 1.
  • added a filter that will stop BASA taking a second trade during the candle in which an earlier trade closed.
  • added Andy's moving average stacking function - details in 'Moving Average stacking' in post 1.
  • added trade stacking - details in 'Trade stacking.' in post 1
Trade stacking has huge potential - we all had a trade or two that moved a few hundred pips last week, so imagine we had taken extra trades as the market moved for us. How to initiate stack trades is going to be the big discussion point.

:D

Sounds awesome Steve...I really like the idea of the stacking trades, I've got 2 nice trades running at the moment at around 150 & 190 pips each, so would be good to take advantage of that type of move.

Also, just having a quick look over the trades so far (will do more in depth analysis over the weekend) but almost all the trades that hit SL were re-entry trades. I'm hoping that a change to using ATR for SL will reduce that significantly, testing results are good so far.
Of the main entry trades only 1 has hit SL, the rest have closed out with JS or at BE+2.

So wondered is it possible to turn on/off re-entry trades in case someone would prefer to only trade main entry's?


thanks again for your hard work :D
Author:  fxozgirl [ Wed Aug 07, 2013 8:57 pm ]
Post subject:  Re: Bob and Shelley Again

OldTrader wrote:
fxozgirl wrote:
Ok, fair call 8-)
I thought I had specified that for re-entry trades, but looking back I hadn't...
So, can we have it so it only trades once per candle?
and there has to be a close above/below 60 lwma to validate the set up.

Main entry's all look to be good :D
So now there does need to be close above/below lwma for reentry?
Yes, this was always the case...it was my bad that it wasn't done initially, Steve had already fixed this part.
Author:  MrLong [ Wed Aug 07, 2013 9:03 pm ]
Post subject:  Re: Bob and Shelley Again

SteveHopwood wrote:
MrLong wrote:The Ma's I actually use for the stack are the 21 EMA and 55 EMA:

Code: Select all

 if (useMaStack && (!detectMaStack(CurrentPair, PERIOD_H4, 21, 55, 0, MODE_EMA, PRICE_CLOSE, OP_BUY, 0)))
I can add stacking moving average inputs as user choices. Why these particular ones?
I also use the CSS H1 to try confirm the pullback is over and CSS H1 strength starts heading in my direction with:

Code: Select all

 extern double breakDifferenceThreshold    = 3.5;   // for the break slope .

  if (useCSSH1 && (!cssLongH1 > cssShortH1))
            continue;

 if (useCSSH1 && (!MathAbs(myDiff) > breakDifferenceThreshold))             // got to have broke out  and into my direction
        continue;
Hope this also helps

Andy
The second bit does not unless I am right in this: you use Lib.CSS to find the values of cssLongH1 and cssShortH1? And that the two variables are those that you have defined elsewhere in your code?

Actually, now I read it after posting, the makes no sense. Nope, not a clue what you mean. :lol:

:D
Hi Steve,

Yes , sorry I get the values from the CSS.Lib to try to confirm, the pullback is over on an hourly TF.
Author:  SteveHopwood [ Wed Aug 07, 2013 9:18 pm ]
Post subject:  Re: Bob and Shelley Again

fxozgirl wrote: So wondered is it possible to turn on/off re-entry trades in case someone would prefer to only trade main entry's?
Took about 30 seconds. Also added the choice to turn off Main trades - 'First trade choices' at the bottom of 'General inputs'.

V 1h in post 1.

Haven't updated the post 1 blurb mind - sick to death of updating post 1. There are about 60 people in this forum with the authority to do nearly anything they want - one of you couldn't update post 1, could you?

:D
Author:  SteveHopwood [ Wed Aug 07, 2013 9:44 pm ]
Post subject:  Re: Bob and Shelley Again

That damn modification did not work - I closed down my re-entry trades and the blasted bot took them again straight away. I have removed it from post 1 and will sort it out in the morning. It is late here in the UK and I am far too irritated to try to deal with it right now.

:D
Author:  MrLong [ Wed Aug 07, 2013 10:57 pm ]
Post subject:  Re: Bob and Shelley Again

SteveHopwood wrote:That damn modification did not work - I closed down my re-entry trades and the blasted bot took them again straight away. I have removed it from post 1 and will sort it out in the morning. It is late here in the UK and I am far too irritated to try to deal with it right now.

:D

Hi Steve,

One trade per bar:

Code: Select all

extern bool useOneTrade        = true;

extern int  barTimeframe = PERIOD_H4;

//+------------------------------------------------------------------+
//|  Checks number order for the  timeframe                                    |
//+------------------------------------------------------------------+
int checkBarOrders(){
int barOrders = 0;
for(int i = OrdersTotal()-1; i >=0; i--){
OrderSelect(i, SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol() && (OrderOpenTime() >= iTime(Symbol(), barTimeframe, 0))) {
barOrders += 1;
}}

for(i = OrdersHistoryTotal()-1; i >=0; i--){
OrderSelect(i, SELECT_BY_POS,MODE_HISTORY);
if( OrderSymbol()==Symbol() && (OrderCloseTime() >= iTime(Symbol(),barTimeframe, 0))) {
barOrders += 1;
}}
return(barOrders);
}

And call like:

Code: Select all

        if( useOneTrade && checkBarOrders () >= 1)
         continue;

Assuming this is what you are looking to do.

Best Regards

Andy
Author:  SteveHopwood [ Thu Aug 08, 2013 7:53 am ]
Post subject:  Re: Bob and Shelley Again

V 1i is in post one. Turning off re-entry trades works now.

Adding the stacking code broke the logic that told BASA to stop looking for trades when there was neither a Main or a Re-entry trade, so it thought there was a re-entry trade whenever the market was on the correct side of the 60.

It is behaving on my account now, so over to you Shelley for your research this weekend.

:D
Author:  SteveHopwood [ Thu Aug 08, 2013 7:56 am ]
Post subject:  Re: Bob and Shelley Again

MrLong wrote:
SteveHopwood wrote:That damn modification did not work - I closed down my re-entry trades and the blasted bot took them again straight away. I have removed it from post 1 and will sort it out in the morning. It is late here in the UK and I am far too irritated to try to deal with it right now.

:D

Hi Steve,

One trade per bar:

Code: Select all

extern bool useOneTrade        = true;

extern int  barTimeframe = PERIOD_H4;

//+------------------------------------------------------------------+
//|  Checks number order for the  timeframe                                    |
//+------------------------------------------------------------------+
int checkBarOrders(){
int barOrders = 0;
for(int i = OrdersTotal()-1; i >=0; i--){
OrderSelect(i, SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol() && (OrderOpenTime() >= iTime(Symbol(), barTimeframe, 0))) {
barOrders += 1;
}}

for(i = OrdersHistoryTotal()-1; i >=0; i--){
OrderSelect(i, SELECT_BY_POS,MODE_HISTORY);
if( OrderSymbol()==Symbol() && (OrderCloseTime() >= iTime(Symbol(),barTimeframe, 0))) {
barOrders += 1;
}}
return(barOrders);
}

And call like:

Code: Select all

        if( useOneTrade && checkBarOrders () >= 1)
         continue;

Assuming this is what you are looking to do.

Best Regards

Andy
Thanks Andy, but the problem was a structural one that has nothing to do with my one trade per bar code, which was not being called because of the stuff broken by the stack code. Thanks anyhow.

:D
All times are UTC Page 12 of 120