Hi Shane,
I will try to get is uploaded tonight. Do you have a 4 or 5 point broker?
The only settings youwill be able to change on the EA is the magic number, TP, SL, risk and to enable the trailing stop. The source code won’t be available.
Hi Shane,
I will try to get is uploaded tonight. Do you have a 4 or 5 point broker?
The only settings youwill be able to change on the EA is the magic number, TP, SL, risk and to enable the trailing stop. The source code won’t be available.
5 digits broker. sure. I would like to try out the best profitable TP/SL .
Hi Everyone,
Attached is 3 Ducks based EA called: Plutus Trend EA
The options you have when attaching the EA in Metatrader are:
StopLoss - Depending if your broker is a 4 or 5 point broker depends what you enter, for example if you want to have a 30 pip SL and you have a 4 point broker, enter 30. If you have a 5 point broker, then enter 300. (Default: 300 - 30pips)
TakeProfit - As above. (Default: 300 - 30pips)
Risk - This is a percentage of your total free margin. (Default: 2)
MagicNumber - Used if you have multiple EAs running. (Default: 1)
EnableTrailing - Enabled the trailing stop. This will keep the stoploss X pips (as specified in the StopLoss setting) away from the current price. (Default: false)
The EA can be attached to any time frame and changing between timeframes will not affect the EA.
Since I am sharing this EA, I would be grateful if you would share your results via myfxbook.
Plutus Trend EA.zip (13.5 KB)
I will make a new demo account and use for the test. Will upload the link of myfxbook here tomorrow
did u backtest before this EA?
Hi aidyspruole
Use this code in your EA and it will adjust for 4 or 5 digit brokers. Basically it sets the variable UsePoint to the correct multiplier dependant on your broker the first time the EA is run.
//External variables
extern double StopLoss = 50;
// Global variables
double UsePoint;
// Init function
int init()
{
UsePoint = PipPoint(Symbol());
}
// Within your code
StopLoss = StopLoss * UsePoint;
/ /Pip Point Function after all you code
double PipPoint(string Currency)
{
int CalcDigits = MarketInfo(Currency,MODE_DIGITS);
if(CalcDigits == 2 || CalcDigits == 3) double CalcPoint = 0.01;
else if(CalcDigits == 4 || CalcDigits == 5) CalcPoint = 0.0001;
return(CalcPoint);
}
// Taken from the book 'Expert Advisor Programming “ by Andrew R Young.
I understand you don’t want to give all your EA coding away but can you share your set up to enter a trade. I have built my own EA for the 3 Ducks and I use a new Open above double BxH = High[iHighest(NULL,0,MODE_HIGH,48,0)]; to find the high of the last four hours to enter long once the 3 Ducks align and my initial stop is the 60 SMA and I then trail using double BxL = Low[iLowest(NULL,0,MODE_LOW,48,0)];
I was just wondering if you could share the mechanics if not the code, either openly on this forum or privately?
Happy pip hunting Trader009.
I face some problem when using the EA , why the lot size is random? I plan to set lot size of 0.01 - 0.10 . But the EA randomly set 0.90 lot size. How to change that?
1 more question. The EA is based on previous low or ? Because sometimes the pending order made by EA seems like not fulfill the requirement of 3 ducks~
Lots size are based on the risk percentage, stoploss and free margin. This just the way I have the EA setup, I haven’t configured it for setting a set lot size. I will plan to code this in.
It’s not setting the order at the previous high\low. It sets the order at 2 times the stoplevel set by your broker, away from the current price.
Bear in mind that the EA is based on the 3 duck strategy, not following it exactly as it is based on trader discretion.
I will look into adding the option for the trader to enter a trading based on the highest\lowest bar in the previous X bars.
but in my laptop I get pending of 0.10 , but in my desktop I get 0.90 sometimes 0.37 .
Free margin is also part of the lot size calculation, so as this changes the lot size will change.
but the stoploss , tp and risk are the same for laptop n desktop , still there is a diff in lot size
The lot size changes will be down to your free margin continually changing. When orders are placed, this automatically uses up free margin so if you add the EA to your desktop and it places a number of pending trades, your free margin will have changed so by the time you setup the EA on your laptop, your lot sizes will be smaller. Any open trades will also affect this. I have lot sizes ranging from 0.38 to 1.01.
It’s part of money management.
This is also part of the reason for the difference in lot sizes - Complex Position Sizing | Position Sizing | Learn Forex Trading
U don mind to include the setting of lot size in EA?
I’ll try to add it in tonight and upload again.
Thanks for the code Trader009.
I’ll PM you the details later this evening.
Hi Folks,
I have attached an updated EA, DO NOT USE THE EA IN THE PREVIOUS POST!
When updating the code I noticed and major issue with the trading criteria for opening of the the sell positions, which after analysing it in myfxbook, there was a big difference in the results for the buy and sells. Buy positions made 115 pips over 9 trades, sell positions made a loss of -20.8pips over 18 trades. Not Good! :15:
Below are the options you have when attaching the EA in Metatrader are:
StopLoss - Self explanatory. Code is now fixed and you can just enter the number of pips with having to worry about how many points your broker has. (Thanks Trader009) (Default: 30 pips)
TakeProfit - As above. (Default: 30 pips)
Risk - This is a percentage of your balance you wish to risk. (Default: 2)
MagicNumber - Used if you have multiple EAs running. (Default: 1)
EnableTrailing - If set to true, the stoploss will trail after the current price by the distance specifed in the StopLoss option. If set to false, the stoploss will be set as per the StopLoss option. (Default: false)
EnableAggressiveTrailing - If set to true, this will open positions at twice your brokers stop level once the trade criteria is met. If set to false, the EA will find the previous highest\lowest bar within the number of bars from the current bar, plus the stop level as specified by your broker. The number of previous bars is checks is based on the next option. (Default: true)
FindHighLowBars - See previous option. The number of previous bars the EA will check to find the highest\low bars. (Default: 10)
SetManualLot - If set to true, you can specify the lot size for trades. If set to false, lot sizes are based on the StopLoss, Risk and available free margin. (Default: false)
LotSize - Trader can set the lot size for trades if previous option is set to true. (Default: 0.01)
The EA can be attached to any time frame and changing between timeframes will not affect the EA.
Plutus Trend EA.zip (14.7 KB)
As before, please share your results.