Breakeven Strategy

Strategies are published here.

Moderator: admin

Re: Breakeven Strategy

Postby SJB944 » Fri Feb 24, 2012 1:44 am

OK, I can get it to work only if the position doesn't already have a stop loss!

Is it possible to update so that an initial stop loss is moved to Break Even after a set profit target is reached.

Cheers
SJB944
 
Posts: 13
Joined: Wed Apr 06, 2011 2:40 am

Re: Breakeven Strategy

Postby PipGrabber » Fri Feb 24, 2012 1:55 am

SJB944 wrote:Still can't get it to work even if only have one position open on a chart at a time. Same error.


Hi SJB944,

Maybe you should stop the strategy and open it again with a new opened trade by default. I think your just updating the breakeven strategy by the drop down list of the ticket number and press apply. As per my observation. It does not work in that manner (don't know why, the strategy detects the trade ticket, but doesn't seem to be loaded during initialization). That's why I have to close and open again the strategy manually each time.

And occasionally you'll get those errors you've mentioned. Just have to open and close again...no choice. :D
User avatar
PipGrabber
 
Posts: 46
Joined: Fri Jan 21, 2011 9:22 am

Re: Breakeven Strategy

Postby SJB944 » Sun Feb 26, 2012 5:21 pm

Nope, was opening Break Even Strategy new for each trade.
SJB944
 
Posts: 13
Joined: Wed Apr 06, 2011 2:40 am

Re: Breakeven Strategy

Postby Alokasi » Fri Mar 02, 2012 2:37 am

I've hacked up this code for my own use. I managed to get it to detect the existing stops (I think). It seems to detect a Net Stop and move it anyway. I also have it detect the position of the stop so that you can move it manually.

I added another feature too - a gap from the price action, essentially I've made this work as a stepping trailing stop.

If you want it to move to break even and stay there set the "min profit" to 0.0 and the "lead gap" to whatever (i.e. 20 pips). When the price at the close of the time frame bar exceeds the gap the stop will move to the open price. If min profit is set to a number (i.e. 1.0) then the stop will move when the bar closes at gap+lead and will move to open + profit pips.

For example:
Timeframe: m1
Min profit: 1.0
Lead gap: 20.0

This will move the stop to open price +1 pip profit when a 1 minute bar closes at open price +21 pips. If another 1 minute bar closes at stop price + 21 pips, the stop will move up to open price +2 pips. There will always be greater than 20 pips gap every time the stop moves.

Timeframe: m5
Min profit: 10.0
Lead gap: 5.0

In this case the first stop move will occur when a 5 minute bar closes at open price + 15 pips and it will be set at open price + 10 pips with a 5 pip cushion. When another 5 minute bar closes at Stop price + 15 pips, the stop will move to open price + 20 pips with a minimum of 5 pips cushion. Thus this setup protects profits in 10 pip increments.
Attachments
Breakeven Strategy.lua
(7.74 KiB) Downloaded 1356 times
Alokasi
FXCodeBase: Confirmed User
 
Posts: 8
Joined: Wed Nov 09, 2011 1:10 pm

Re: Breakeven Strategy

Postby subliminal » Thu Mar 08, 2012 7:27 pm

Thank you for an amazing indi! and thank you for the improvements Alokasi they are great!

I wanted to ask if its possible to add a fractal option and scaling option?

My idea is that when price reaches a predefined level two things will happen.
1) The indi will automically close a predefined portion of the lots
2)The indi will move the stop to breakeven or lower according to lead gap

Then from there the fractal option takes over and the stop is moved according to fractals to get as much pips as possible. When price finally reaches the stop it will close the rest of lots.

Example

I go long 1.3100 risking 10 lots. My predefined 'Take Profit' is 15 pips and I want half the lots (5) to be closed at that level. I also want the lead gap to be 5 pips.

Price goes to 1.3115 and automatically 5 lots are closed and my stop is moved to 1.3110 (lead gap for a bit of breathing space).

Then from there the stop is moved according to fractals and lets say i'm stopped at 100 pips then the remaining 5 lots are closed.
subliminal
 
Posts: 16
Joined: Wed Nov 02, 2011 3:51 pm
Location: London

Re: Breakeven Strategy

Postby TraderKen » Mon Mar 12, 2012 1:47 am

Hi Apprentice and other forum members,

This strategy only works for one position of one pair at anytime. If you open multiple positions, all will be closed when any position meets its criteria. This is extremely dangerous for your trading account.

Please help fix this issue. Thanks.
TraderKen
 
Posts: 14
Joined: Sat Oct 22, 2011 3:58 pm

Re: Breakeven Strategy

Postby PipGrabber » Wed Aug 08, 2012 9:02 am

Hope somebody can update this strategy that it can automatically detect new open trades. So no need to manually choose a new ticket every time a the open position is closed and a new open ticket is issued. :roll:
User avatar
PipGrabber
 
Posts: 46
Joined: Fri Jan 21, 2011 9:22 am

Re: Breakeven Strategy

Postby PipGrabber » Thu Jan 17, 2013 8:49 am

Hi Apprentice,

Still waiting for the update on this strategy to automatically detect new opened positions by other strategies, rather than manually choosing the ticket number each time a new position is opened. (Very tedious if in 1min time frame). Looking forward to it soon.. Thanks!
User avatar
PipGrabber
 
Posts: 46
Joined: Fri Jan 21, 2011 9:22 am

Re: Breakeven Strategy

Postby PipGrabber » Thu Aug 08, 2013 5:51 am

Apprentice wrote:In theory, yes.
I hope I will find time soon.


Still looking forward when you'll have time to automatically update the trade ticket. So that this strategy would continuously run and function on every new trade is being opened.
User avatar
PipGrabber
 
Posts: 46
Joined: Fri Jan 21, 2011 9:22 am

Re: Breakeven Strategy

Postby Silverthorn » Thu Feb 06, 2014 11:03 am

Does this work on trades that are opened by other strategies?
User avatar
Silverthorn
 
Posts: 69
Joined: Fri Nov 08, 2013 12:29 am
Location: Brisbane Australia

PreviousNext

Return to Custom Strategies

Who is online

Users browsing this forum: Bing [Bot] and 15 guests