collapse

Author Topic: Advanced Trailing Stop EA  (Read 118625 times)

Offline kennyhubbard

  • Full Member
  • ***
  • Posts: 160
    • compu-forex.com
Re: Advanced Trailing Stop EA
« Reply #30 on: March 14, 2011, 11:42:54 AM »
jsintl,

Actually let me clarify.....

It will not just sieze control of FGB's trades. Once a trade goes into profit, it will run a trailing stop to ensure that the trade doe not retrace into loss. It is very important to realise that if the trade does not reach the trigger level(no of pips where the EA starts the trail), it may never actually control the trade.

BEWARE........it does not control losing trades. If FGB loses control of a trade and it runs negative, it is up to you to exit that position. This EA cannot help you in that particular instance.
Wealth Creation Through Technology
www.compu-forex.com


Offline jsintl

  • Full Member
  • ***
  • Posts: 225
Re: Advanced Trailing Stop EA
« Reply #31 on: March 14, 2011, 04:26:50 PM »
Thanks Kenny for the clarification.

I was thinking of using this EA for all EAs with 15 pips or more TP.  Will demo first to see how it goes.

Brgds,
jsintl

Offline hogdustwillie

  • Jr. Member
  • **
  • Posts: 88
Re: Advanced Trailing Stop EA
« Reply #32 on: March 15, 2011, 06:23:19 PM »
Hi Guys,

Here is a trailing stop EA that I have made. I like to think of it as a pretty advanced EA but that is for you guys to decide 8)

Use of the Compuforex Trailing Stop

Typical User default settings are as follows :-

   
  • MagicNumber    = -1
  • Own_Symbol_Only = false
  • Trail_Start    = 10
  • Trail_Max      = 50
  • Trail_Percent  = 50
  • Trail_Min      = 5
  • Use_Decay      = true
  • Decay_Rate     = 1
  • Wait_Bars      = 4
  • Min_Mod        = 0.5
  • Audio_Alert    = true
The trailing stop has the following feature/functions :-

1.     Trail starts at number of pips defined by the user;
2.     EA will trail your order by a % of the profit as defined by the user e.g. 50% trail>>>>20 pips profit = 10 pips trail;
3.     Trail is limited to a maximum trail by the user e.g. 50% of profit until trail reached 50 pips, thereafter trail at constant 50 pips;
4.     The EA can reduce(or decay) the trail % at a user defined rate per bar;
5.     The user can choose to have the EA accelerate the trail decay;
6.     The user can have the EA wait before the trail decay commences;
7.     User can define the minimum pip change to the trail to reduce trade thread activity;
8.     User can choose whether to have an audio annunciation of trail commencement;
9.     A lot of attention has been given to order persistence. You can close the EA or crash the platform and the EA will pick up where
             it left off, having recorded all trade information to file. When reloading the EA, the file is verified against existing trades
       and old data discarded, new data added and only valid data is used.
10.    There is more screen output that keeps the user informed as to the EA's activity.
11.    The EA will trail multiple currencies simultaneously, automatically correcting for 4/5 digit brokers and 2/4 digit instruments;
12.    The user can choose to use on only a single currency if required.;
13.    The user can elect to trail only a specific MagicNumber if required   

A brief explanation of the settings :-

MagicNumber - Use this to set a specific MagicNumber to be trailed. This is when you are using this EA in conjunction with another EA.
                     Set this to -1 to trail all MagicNumbers(including manual trades).
Own_Symbol_Only - if set to true, will ONLY trail the currency pair of the chart on which the EA is loaded.
Trail_Start    - This is the number of pips in profit a trade must be for the EA to commence trailing a trade.
Trail_Max      - As profit increases, so will the trail....this setting sets the maximum number of pips in trail that the trail will be allowed.
Trail_Percent    - this is the % of profit to trail by. A big % equals a long trail. E.g 100% would be break even. 5% would be a very tight trail.
Trail_Min        - this is used in conjunction with the trail decay. The trail % is reduced over time(per bar) down to this value in this case 5%.
Use_Decay        - Tell the EA if you want to use the trail decay or not.
Decay_Rate       - this is the rate at which the trail decay will occur. In this example, the trail will reduce from 50% at a rate of 1% per bar.
                       There is more than 1 way to use this bcause an additional variable is the timeframe of your chart. You could run this on the M1 chart
                       which would result in a decay rate of 1% per minute. You could also run on the M5 which would result in a decay rate of 12% per hour,
                       etc, etc.....
Exp_Decay        - this is for an exponential decay. In this case, the initial decay rate is by default 1% and you cannot change that. On the first bar, the
                       trail is reduced by 1%, on the next bar it is reduced by 2% and then 4% on the next bar. My thinking is this would be good for catching breakouts.
Wait_Bars        - Oncethe trail is running at the Trail_Percent, this setting will tell the EA to wait before it starts to decay the trail. You may want to trail at 75%
                     for 30 minutes and then only start winding in the trail.
Min_Mod          - This setting tells the EA not to adjust the trail with every single 1/10 pip but will only make changes every 0.5 pips. This reduces thread activity which
                     may be a factor if you are trading several EA's(think of 'Trade Context is Busy').
Audio_Alert       - Enables or diables the trail commencement audio alarm(was more useful for me for testing).
Show_Info      - Enables/Disables on-screen output. Output is for user benefit only. If you do not need it, turn it off to conserve resources.
Text_Color     - You can now select the color of the text for the screen output.

You are welcome to ask questions but please don't ask me what settings work best. You need to experiment and determine those....and feedback will be appreciated.

Updates :

24 Feb 2011.....as is common practice on many forums, the latest update to this EA will always be found on the first post.


I like this idea, but being new to this I do not understand some of the settings and the implications, ie: the trail settings, decay settings, the wait setting, and the min mod setting ... I sthere somewhere I can get a little better explanation as to what these are the implications of raising them or lowering them?

Thanks



Offline hogdustwillie

  • Jr. Member
  • **
  • Posts: 88
Re: Advanced Trailing Stop EA
« Reply #33 on: March 17, 2011, 02:54:25 AM »
it looks like a ghost town in here ... yall move from ea to ea alot ... how do you have any time left to trade. Anyhoo, i think i might have this one figured out, but one question ... if you are trading say the eur/usd pair on a m5 and m15 ... open this ea on a separate chart, leave at -1, will it control both timw frames correctly? or should you open 2 charts and control each by magic number for that particular charts time frame.

A quick response would be great.

Thanks.

Offline kennyhubbard

  • Full Member
  • ***
  • Posts: 160
    • compu-forex.com
Re: Advanced Trailing Stop EA
« Reply #34 on: March 17, 2011, 03:17:35 AM »
Either solution will work just fine. I assume when you refer to the M5 & M15 TF, you mean you have 2 EA's trading those timeframes?

It depends on what you want to do.......with MagicNumber set to -1 the EA will enter a trail on ALL trades. If you have 2 EA's running, but lets say you didn't want my EA to trail your manual trades(for example), then you would have 2 instances(on 2 charts) with the relevent MagicNumbers of the two EA's.
Wealth Creation Through Technology
www.compu-forex.com


Offline hogdustwillie

  • Jr. Member
  • **
  • Posts: 88
Re: Advanced Trailing Stop EA
« Reply #35 on: March 17, 2011, 03:30:25 AM »
Either solution will work just fine. I assume when you refer to the M5 & M15 TF, you mean you have 2 EA's trading those timeframes?

It depends on what you want to do.......with MagicNumber set to -1 the EA will enter a trail on ALL trades. If you have 2 EA's running, but lets say you didn't want my EA to trail your manual trades(for example), then you would have 2 instances(on 2 charts) with the relevent MagicNumbers of the two EA's.

thanks for the quick response ... yes 1 ea on the m5 and 1 ea on the m15 ... you program works great my megadroid was up over 10% today thanks to your help. I was just wondering if I had your ea open and running on a m15 chart, and it is looking at the m15 timeframe, does it have any issues controlling the m5 or m30 or h1 simultaneously.

Offline kennyhubbard

  • Full Member
  • ***
  • Posts: 160
    • compu-forex.com
Re: Advanced Trailing Stop EA
« Reply #36 on: March 17, 2011, 03:46:03 AM »
This EA ONLY looks at MagicNumber, so the timeframe that the trade was entered on makes no difference. Just be aware that the decay function uses bars, so the H1 TF will decay far more slowly than the M5. I personally would use it on the M1, but that depends on your own strategy.
Wealth Creation Through Technology
www.compu-forex.com


Offline hogdustwillie

  • Jr. Member
  • **
  • Posts: 88
Re: Advanced Trailing Stop EA
« Reply #37 on: March 17, 2011, 03:55:08 AM »
This EA ONLY looks at MagicNumber, so the timeframe that the trade was entered on makes no difference. Just be aware that the decay function uses bars, so the H1 TF will decay far more slowly than the M5. I personally would use it on the M1, but that depends on your own strategy.

your ea on the m1 or the other ea ... just to be clear ..

Offline kennyhubbard

  • Full Member
  • ***
  • Posts: 160
    • compu-forex.com
Re: Advanced Trailing Stop EA
« Reply #38 on: March 17, 2011, 04:21:33 AM »
My EA on M1......other EA TF as per its own documentation.
Wealth Creation Through Technology
www.compu-forex.com


Offline hogdustwillie

  • Jr. Member
  • **
  • Posts: 88
Re: Advanced Trailing Stop EA
« Reply #39 on: March 17, 2011, 04:22:48 AM »
got it
 thanks. ;D

Offline Adong

  • Jr. Member
  • **
  • Posts: 8
Re: Advanced Trailing Stop EA
« Reply #40 on: March 19, 2011, 12:51:29 AM »
Kenny:
I haven't tried your EA yet but it looks great. Thanks for everything!
I read through everything in this forum and wonder instead of Trail Start at 10, what if it is a smaller number say 2 or 3? It gives your EA control earlier and it should be a good thing?

Adong

Offline kennyhubbard

  • Full Member
  • ***
  • Posts: 160
    • compu-forex.com
Re: Advanced Trailing Stop EA
« Reply #41 on: March 19, 2011, 01:20:02 AM »
Hi Adong,

I think this would depend on the frequency of your trading strategy. If you have an EA that makes 20 trades a day then it may be worthwhile setting the trail start to a lower figure, but if your EA trades once or twice a day and typically goes for a generous takeprofit, then the trade may need room to breath. Bear in mind that setting the SL to breakeven when at 2 or 3 pip profit, will stop you very often simply due to the small variation in price before any significant move can take place.

I don't know what the best settings are.......and they will also be different from strategy to strategy, and probably from currency pair to currency pair.
Wealth Creation Through Technology
www.compu-forex.com


Offline kennyhubbard

  • Full Member
  • ***
  • Posts: 160
    • compu-forex.com
Re: Advanced Trailing Stop EA
« Reply #42 on: March 21, 2011, 04:38:37 AM »
New update.........added to post 1.
Wealth Creation Through Technology
www.compu-forex.com


Offline Adong

  • Jr. Member
  • **
  • Posts: 8
Re: Advanced Trailing Stop EA
« Reply #43 on: March 21, 2011, 04:08:44 PM »
Hi Kenney:
The on/off button of auto alert doesn't work. I turned the alert off and yet it still woke me during the night! Any suggestion?
Otherwise it works beautifully! Many thanks!
Adong

Offline malinrob

  • Jr. Member
  • **
  • Posts: 42
Re: Advanced Trailing Stop EA
« Reply #44 on: March 21, 2011, 04:27:26 PM »
If this is not s secret what settings did you use for Megadroid?
Thx a lot.


Either solution will work just fine. I assume when you refer to the M5 & M15 TF, you mean you have 2 EA's trading those timeframes?

It depends on what you want to do.......with MagicNumber set to -1 the EA will enter a trail on ALL trades. If you have 2 EA's running, but lets say you didn't want my EA to trail your manual trades(for example), then you would have 2 instances(on 2 charts) with the relevent MagicNumbers of the two EA's.

thanks for the quick response ... yes 1 ea on the m5 and 1 ea on the m15 ... you program works great my megadroid was up over 10% today thanks to your help. I was just wondering if I had your ea open and running on a m15 chart, and it is looking at the m15 timeframe, does it have any issues controlling the m5 or m30 or h1 simultaneously.


 

browse forum

* Recent Posts

Re: Archer Asset Management by namrfigk
[Today at 06:31:27 AM]


Re: Archer Asset Management by namrfigk
[Today at 06:29:34 AM]


Re: Archer Asset Management by Nasdaq100
[Today at 06:18:08 AM]


Re: Archer Asset Management by F1Maniac
[Today at 05:31:27 AM]


Re: Archer Asset Management by namrfigk
[Today at 05:26:25 AM]


Re: Archer Asset Management by namrfigk
[Today at 05:23:39 AM]


Re: Archer Asset Management by petersurrey
[Today at 05:19:20 AM]


Re: Archer Asset Management by Nasdaq100
[Today at 05:00:33 AM]


Re: Archer Asset Management by namrfigk
[Today at 04:06:04 AM]


Re: Archer Asset Management by namrfigk
[Today at 03:04:12 AM]