
06-07-2008, 11:48 PM
|
|
Senior Member
|
|
Join Date: Oct 2005
Location: Porto/Portugal
Posts: 279
|
|
Quote:
Originally Posted by AirforceMook
This would be extremely difficult to code if you're actually trying to set the stoploss values on the orders. If you can leave your EA running at all times, as I would think you do, then it's not too difficult.
Please see the attached code. I haven't had time to test it, so be sure to look at it prior to use.
Settings:
equity_lock How much you want to ensure you keep, once lock_start has been hit.
equity_lock_start At what profit do we start locking in equity?
equity_target At this amount of profit we close all orders
Example:
100,130,500 - If we get to $130 profit, then we'll lock in $100. If we get to $500 profit, we close all orders.
Realize that because this is a stand-alone EA, it's not very friendly. It ignores magic numbers and manual orders and will take everything into account.
|
Very nice idea.. I'll try it..
Thank you
|