Breakeven Strategy

Strategies are published here.

Moderator: admin

Re: Breakeven Strategy

Postby toxxum » Tue Dec 16, 2014 11:12 pm

moomoofx wrote:"Net Stop" mode such that it sets the stops on all trades to be the net break-even --- added to the to-do list.

Cheers,
MooMooForex


Terrific, thanks so much!
toxxum
 
Posts: 29
Joined: Sun Apr 28, 2013 8:47 am

Re: Breakeven Strategy

Postby muz1979 » Tue Mar 31, 2015 9:24 pm

BreakEvenAll.LUA is working fine but i also want to be able to close half my position as soon as break even is set. I heard this was in development. has that completed?
muz1979
 
Posts: 7
Joined: Tue Mar 31, 2015 9:15 pm

Re: Breakeven Strategy

Postby Apprentice » Wed Apr 01, 2015 4:20 am

Your request is added to the development list.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Breakeven Strategy

Postby daniel.kovacik » Thu Apr 09, 2015 10:26 pm

Hi,

can some strategy open orders in some direction when I trigger buy/sell order.
This strategy would automatically trigger advanced orders like breakeven, partial sell, trailing stop after breakeven, target points... I ll only choose size (risk) and SL and target points will automatically set to 1:x (loss:profit).

Or some strategy, which will open another orders which are similar to first one but one trigger (buy/sell). Something like mirroring of postions and multiple.
But at same price and time. Also with different limit orders for partial sell for at least 2 - 3 target points.

Thanks
Regards,
DK
daniel.kovacik
FXCodeBase: Initiate
 
Posts: 163
Joined: Thu Jun 12, 2014 9:09 pm

Re: Breakeven Strategy

Postby Apprentice » Sun Apr 12, 2015 10:12 am

Advanced position sizing and risk management is possible.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Breakeven Strategy

Postby 4x4partners » Fri May 08, 2015 2:10 am

Hi there,

I wanted to let you know that I am receiving the following error with BREAKEVEN Strategy:

"Failed create/change stop Cannot place more than one order of this type for each trade."

Does this occur if your order already has a stop order set?

More importantly, I'm wondering if the Exit Partial option has been - or could be - added (preferably to the BreakevenALL strategy).

The option to Target an initial TP / BreakEven level (along with Exit Partial option) based on ATR and/or Fractal would be amazing as well !

Kindly let me know if this can be done.

Thanks a lot!

Best
4x4
4x4partners
 
Posts: 53
Joined: Thu Apr 09, 2015 7:23 am

Re: Breakeven Strategy

Postby 4x4partners » Wed May 13, 2015 8:27 am

The SetTrailing option in BreakEvenAll strategy doesn't seem to work. It correctly sets the stop to trail, but then every time the stop moves up it sets it back to the BreakEven position.

Could you kindly have a look to fix this.

Basically, it should only set the stop to BreakEven point once, and then let the Trailing Stop go until trade closes out.

Thanks
4x4partners
 
Posts: 53
Joined: Thu Apr 09, 2015 7:23 am

Re: Breakeven Strategy

Postby 4x4partners » Thu May 14, 2015 7:58 am

In reference to my above issue regarding BREAKEVENALL:

I modified a few lines in ExtUpdate in order to check to see if the current stop is better than breakeven. Seems to work.

If anyone wants the code, I've pasted it below.

Basically replace these 5 lines:

Code: Select all
           if (tradeRow.IsBuy) then
                stopValue = openPrice + (gap * instance.bid:pipSize());
            elseif (not tradeRow.IsBuy) then
                stopValue = openPrice - (gap * instance.bid:pipSize());
            end



With the below, which adds the additional check:

Code: Select all
           if (tradeRow.IsBuy) then
                stopValue = openPrice + (gap * instance.bid:pipSize());

            -- check if the stop is better than the BreakEven level, if so, do nothing and exit
                    if stopValue < tradeRow.Stop then
                        return;
                    end

            elseif (not tradeRow.IsBuy) then
                stopValue = openPrice - (gap * instance.bid:pipSize());

            -- check if the stop is better than the BreakEven level, if so, do nothing and exit
                    if stopValue > tradeRow.Stop then
                        return;
                    end
            end
4x4partners
 
Posts: 53
Joined: Thu Apr 09, 2015 7:23 am

Re: Breakeven Strategy

Postby D37945 » Thu May 14, 2015 1:04 pm

Hi 4x4partners,

Thanks so much for posting this! This is exactly what I'm looking for. I do have two questions:

1. What would I put in the parameters if I want my SL to me moved to breakeven after 20 pips profit then trail the stop every 10 pips? (is 10 pip trailing stop to tight)

2. Should I not set a TP with these orders? Will setting a TP mess up the strategy?

Again thanks so much!
D37945
 
Posts: 5
Joined: Wed Aug 15, 2012 3:21 pm

Re: Breakeven Strategy

Postby 4x4partners » Fri May 15, 2015 4:44 am

Hi D37945,

I'm not the author of the original, but as far as I can tell:

1. This strategy doesn't allow for a "Fixed" trailing stop, just a dynamic one... meaning for every pip up/down, the strategy moves stop with it (in direction of the trade). It shouldn't be too hard to add the option for a "fixed" trail, but would need to be coded.

2. Setting a TP or SL with the orders shouldn't interfere at all. Your TP (limit order) should stay the same.

Again, I'm not the author, and have only recently begun testing this strategy, so hope that's helpful.

Best
4x4
4x4partners
 
Posts: 53
Joined: Thu Apr 09, 2015 7:23 am

PreviousNext

Return to Custom Strategies

Who is online

Users browsing this forum: No registered users and 12 guests