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

Bob and Shelley Again
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=2759
Page 29 of 120
Author:  spotdespot [ Thu Sep 19, 2013 10:36 am ]
Post subject:  Re: Bob and Shelley Again

Just a quick note Steve - I think there is a minor issue with the lot sizing of stack trades if you use %risk rather than fixed lots. As the SL is divided by X (2 default) the lot size of the stack trades, when using % risk, is double the main trade lot size - which can't be a good idea. I will just stick to fixed lots for now but in an ideal world I would actually prefer to be able to make the stack trade lot sizes smaller than the original trade, but if not then perhaps just set as the same size?

Cheers,
Dave.
Author:  Radar [ Thu Sep 19, 2013 11:14 am ]
Post subject:  Re: Bob and Shelley Again

Hey fxozgirl,
fxozgirl wrote: I have updated my charts with the amended v1v and stackbreakeven line looks like it is being drawn correctly now :D

I think once the stack commences (so 2 or more trades), then everything needs to be contained within the basket. The stackbreakeven line is drawn at x adaptive pips above the calculated break even...perhaps just a simple basket trailing stop would work from that point.

It seem's to me that it would be quite a complex piece of coding (not actually even sure if it would be possible) that would be able to convert the single trades into a basket, delete individual SL's and incorporate a basket trailing stop. Perhaps a good trail would be to trail price by 50 pips (or equivalent to what the jumping stop is set at??

Look at the nzdusd chart below...5 trades are open (so max trades), stackbreakevenline drawn, however trades will all close well before price gets back to the stackbreakeven line as each individual stop loss has still been set. If a basket trailing stop was implemented the stacktakeprofit line would be slightly above the highest SL line currently shown on the chart, which would be ideal in my opinion.
nzdusd.gh4_stackbreakevenenabled.png
There's three ways that I can think of to ensure that all trades are closed at once...

1 Use a hidden trailing stop (hidden from the broker, that is, not us mob)... A line is drawn on the chart, which trails price by TrailingStopPips... When price hits the line, the function CloseAllTrades is called... It's easy enough to code, (he says, after spending 3 weeks working it out) ;) The good thing about doing it this way is that you have a stealth-mode stop... The bad side is that if you lose connection to your broker, you lose your stoploss.

2 When your last scale-in trade hits BreakEven, move all previous trades' stoploss to the last trade's BEP.

3 = 1 + 2 ;)

Hmmm... Looks like I've found a solution to my staggered stoplosses problem with my StackMan EA... Thanks for that! :)

Have fun!

Radar =8^)
Author:  SteveHopwood [ Thu Sep 19, 2013 2:12 pm ]
Post subject:  Re: Bob and Shelley Again

V 1w in post 1.

I have fixed the risk-based lot thingy, I think. CalculateLotSize() works out how many pips there are in the stop, and multiplies this by StackStopLossDivisor to arrive back were we started.

I have added a basket stop loss based on a chart line. From the updated UG:
  • StackTrailingStopPips: the profit in pips that the basket reaches to trigger a trailing stop:
    • This is a dynamic input, that is multiplied by (open trades – 1). For example:
      the input is, say, 20 and there are 4 trades in your basket. The trailing stop will follow 80 pips behind the total pips profit of the basket.
  • BASA will draw a (by default) red line that represents the trailing stop, and close the trades when the Bid crosses the line. Here is my reasoning behind where BASA draws the line:
    • StackTrailingStopPips = 50.
    • Open trades = 5, so the trailing stop = 200 pips.
    • With 5 open trades, each 1 pip movement by the market will add or subtract 5 pips to the basket pips UPL. So, to take 200 pips out of the UPL and close the basket, the line has to be 200 / 5 i.e. 40 pips away from the current market price.
Not sure if my reasoning is correct. The relevant code is in void StackTrailingStop().

I forgot to write in the UG that a zero input in StackTrailingStopPips disables the stack basket trailing stop.

To experiment with this by manually opening a demo basket, find these lines of code:

Code: Select all

      if (ObjectFind(buybeline) > -1) LookForStackBasketClosure(buybeline);//Buy basket BE
      if (ObjectFind(sellbeline) > -1) LookForStackBasketClosure(sellbeline);//Sell basket BE
and comment them out then recompile (Scite lines 3979, 3980).

:D
Author:  spotdespot [ Thu Sep 19, 2013 2:50 pm ]
Post subject:  Re: Bob and Shelley Again

It's looking pretty good to me so far Steve - great stuff - thanks.

Cheers,
Dave.

EDIT: Closed at the red line as expected.
Author:  kwanann [ Thu Sep 19, 2013 3:24 pm ]
Post subject:  Re: Bob and Shelley Again

Didnt turn on stacking, been sitting on a gold mine so far

currently floating about a 100 pips
Trades.PNG
closed about 50pips
Author:  SteveHopwood [ Thu Sep 19, 2013 3:39 pm ]
Post subject:  Re: Bob and Shelley Again

kwanann wrote:Didnt turn on stacking, been sitting on a gold mine so far
Although, when you do and the market takes off............................................
Noname.gif
Ignore the bottom two - I was making sure the breakeven line thingy was fixed.

:D
Author:  kwanann [ Thu Sep 19, 2013 3:47 pm ]
Post subject:  Re: Bob and Shelley Again

SteveHopwood wrote: Although, when you do and the market takes off............................................
:D
Haha yeah i know, 200pips per trade, WOW

Then again, in real life, nobody leaves em running for a few days to garner that amount of pips.

FOMC just turned out great so i'm sitting on a gold mine, if it went the way everyone was expecting, this would have turned into a hell hole :lol:

Anyway i kinda screwed up the competition account opening 20 lots on silver which seems to give $50 per pip, going to get em back and then see if i can catch up with those freaks that have probably quadrupled the amount by now
Author:  SteveHopwood [ Thu Sep 19, 2013 9:43 pm ]
Post subject:  Re: Bob and Shelley Again

I just noticed something wrong in my UG description of the stack basket trailing stop thingy.

Kudos to the first existing BSV's to spot it. Immediate promotion to BSV to any non-BSV who spots it. Attention to detail is vital when dealing with me. :lol:

Only the first poster earns the recognition.

I am typing this on my trading machine, not my development machine. Please remind me if I forget to update the UG.

:D
Author:  spotdespot [ Thu Sep 19, 2013 9:54 pm ]
Post subject:  Re: Bob and Shelley Again

Ha ha. If you mean that you said trades - 1 but then said 4 trades @ 20 pips = 80 not 60 then I win. If not I am still right in my own mind..... :lol:
Author:  SteveHopwood [ Thu Sep 19, 2013 10:16 pm ]
Post subject:  Re: Bob and Shelley Again

spotdespot wrote:Ha ha. If you mean that you said trades - 1 but then said 4 trades @ 20 pips = 80 not 60 then I win. If not I am still right in my own mind..... :lol:
Yep. You win.

Sorry there is no further first prize other than kudos.

Tell you what. In the ridiculously unlikely event that one of your posts irritates me and I respond inappropriately, then you are entitled to demand 1 apology. Keep a copy of this post as evidence.

Alternatively, if you want the nuclear option then you are entitled to ban 1 irritating pillock. I will have to carry out the ban so again, keep a copy of this post as evidence. Use this with care as I will not question your judgement.

:D
All times are UTC Page 29 of 120