Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

bnma

Safe Martingale EA

Recommended Posts

Hi guys,

 

I am looking for help to make this ea (I wrote) better.

 

Basically, I have looked at the FX Pro maker code and saw what it does. I created a very simple version of this ea that uses hedge, trades martingale in a grid fashion but has a disaster stoploss. So the Martingale does not get out of hand.

 

Here's the concept:

 

Right at the initial launch, the EA will create buy/sell order with minimal lots (0.01 or 0.05 depending on broker. But this doesn't matter cause people can do initial 10 lots if they want to). Immediately after placing these orders, it will place pending orders every 5 (or so) pips and doubling up. Each level is the take profit for the order in the same direction but double size. All orders have disster stop loss (User's choice).

 

Here's the grid:

 

........... ------------------------- Disaster SLs (All Sell orders)

Level ... ------------------------- Pending Sell ...

Level 4 ------------------------- Pending Sell (0.16 / TP Level 3 / Disaster SLs)

Level 3 ------------------------- Pending Sell (0.08 / TP Level 2 / Disaster SLs)

Level 2 ------------------------- Pending Sell (0.04 / TP Level 1 / Disaster SLs)

Level 1 ------------------------- Pending Sell (0.02 / TP Level 0 / Disaster SLs)

Level 0 ------------------------- Buy (0.01 / TP Level 1 / SL Level -1) & Sell (0.01 / TP Level -1 / SL Level 1)

Level -1 ------------------------- Pending Buy (0.02 / TP Level 0 / Disaster SLb)

Level -2 ------------------------- Pending Buy (0.04 / TP Level-1 / Disaster SLb)

Level -3 ------------------------- Pending Buy (0.08 / TP Level-2 / Disaster SLb)

Level -4 ------------------------- Pending Buy (0.16 / TP Level-3 / Disaster SLb)

Level ... ------------------------- Pending Buy ...

........... ------------------------- Disaster SLb (All Buy orders)

 

If any take profit is hit, all positions are closed (Live and pending). It's up to the user to set this to auto to start again. However, I don't recommend this. It should bet of the user to see how the market is and then let the EA trade when all conditions are good.

 

The thing I am counting on is a slow market (No news, not London or US sessions). This ea will might get killed if there is a big sudden move. In quiet time (I think), there is a very high chance that the price will retrace to the lower level which is 5 pips away to take profit.

 

Please help me make this code better and also find the best time and best currency pair to put it on.

 

I think we will do something really good for all of us.

 

Link to EA: http://www.4shared.com/file/u-5yAB2Y/Matrix_v1.html

 

Thanks a lot!

Share this post


Link to post
Share on other sites

I have my own private martingale EA. the first thing you should do is bring down the multiplier to 1.5 it's too high at 2.

You also want to code in a option for one direction only this way when you know the market is trending strong you set your EA to only open up trades going with the trend. there are other things you can do but these2 are very important

randy

 

 

 

 

QUOTE=bnma;94535]Hi guys,

 

I am looking for help to make this ea (I wrote) better.

 

Basically, I have looked at the FX Pro maker code and saw what it does. I created a very simple version of this ea that uses hedge, trades martingale in a grid fashion but has a disaster stoploss. So the Martingale does not get out of hand.

 

Here's the concept:

 

Right at the initial launch, the EA will create buy/sell order with minimal lots (0.01 or 0.05 depending on broker. But this doesn't matter cause people can do initial 10 lots if they want to). Immediately after placing these orders, it will place pending orders every 5 (or so) pips and doubling up. Each level is the take profit for the order in the same direction but double size. All orders have disster stop loss (User's choice).

 

Here's the grid:

 

........... ------------------------- Disaster SLs (All Sell orders)

Level ... ------------------------- Pending Sell ...

Level 4 ------------------------- Pending Sell (0.16 / TP Level 3 / Disaster SLs)

Level 3 ------------------------- Pending Sell (0.08 / TP Level 2 / Disaster SLs)

Level 2 ------------------------- Pending Sell (0.04 / TP Level 1 / Disaster SLs)

Level 1 ------------------------- Pending Sell (0.02 / TP Level 0 / Disaster SLs)

Level 0 ------------------------- Buy (0.01 / TP Level 1 / SL Level -1) & Sell (0.01 / TP Level -1 / SL Level 1)

Level -1 ------------------------- Pending Buy (0.02 / TP Level 0 / Disaster SLb)

Level -2 ------------------------- Pending Buy (0.04 / TP Level-1 / Disaster SLb)

Level -3 ------------------------- Pending Buy (0.08 / TP Level-2 / Disaster SLb)

Level -4 ------------------------- Pending Buy (0.16 / TP Level-3 / Disaster SLb)

Level ... ------------------------- Pending Buy ...

........... ------------------------- Disaster SLb (All Buy orders)

 

If any take profit is hit, all positions are closed (Live and pending). It's up to the user to set this to auto to start again. However, I don't recommend this. It should bet of the user to see how the market is and then let the EA trade when all conditions are good.

 

The thing I am counting on is a slow market (No news, not London or US sessions). This ea will might get killed if there is a big sudden move. In quiet time (I think), there is a very high chance that the price will retrace to the lower level which is 5 pips away to take profit.

 

Please help me make this code better and also find the best time and best currency pair to put it on.

 

I think we will do something really good for all of us.

 

Link to EA: 4shared.com - online file sharing and storage - download Matrix_v1.mq4

 

Thanks a lot!

Share this post


Link to post
Share on other sites
I have my own private martingale EA. the first thing you should do is bring down the multiplier to 1.5 it's too high at 2.

You also want to code in a option for one direction only this way when you know the market is trending strong you set your EA to only open up trades going with the trend. there are other things you can do but these2 are very important

randy

 

Hi randy1953, I'm thinking this EA should absolutely stay out of the trending times in the market. That's why I think the quiet times are the best. For the multiplier being 1.5,

I am not sure it will work with this method cause each level takes profit in the lower level on a sell and upper level on buy. Look at this sequence:

 

-1, -2, -4 In order to make profit, you'd have to have something > -7 (total). This would be 8

 

Now with a 1.5 multiplier:

-1, -1.5, -2.25, in order to make profit, you'd have to have something > -4.75. But in this case, the next sequence is 3.375 which can't beat the -4.75

 

Unless this system is changed to take profit further than the previous level, multillier 2 is better than 1.5.

 

Thanks.

Share this post


Link to post
Share on other sites

I think lot increasing grid with 2-3 levels basket and with proper stoploss is better than 12-13 levels basket grid EA. Because those EA who use 12-13 levels basket blow account by single sl hit or two in other word those actually make profit fighting against market moves and once get caught and ur account dies. So accept the sroplosses and run again is fine.

Share this post


Link to post
Share on other sites
I think lot increasing grid with 2-3 levels basket and with proper stoploss is better than 12-13 levels basket grid EA. Because those EA who use 12-13 levels basket blow account by single sl hit or two in other word those actually make profit fighting against market moves and once get caught and ur account dies. So accept the sroplosses and run again is fine.

 

I think constant lot size is safer than lot increasing EAs. But much depends how good the strategy is. It is not that every martingale fails.

Share this post


Link to post
Share on other sites

every system can fail, in case of less equity, sure, martingal (no "e") needs more equity, but if combined with several security features, you will be save and fine.

- async hedges

- dynamic tp, ts, sl (if used)

- basket management

- dynamic step management

- lot management

Share this post


Link to post
Share on other sites

there is no safe martingale system

 

all you can do is be good at deferring risk to another day, but the better you become at this, the larger the drawdown when you eventually have to realize said risk

Share this post


Link to post
Share on other sites

Right, nothing is safe so we have to take risk for our profit in the trading market. But I wish that I can see the EA mentioned above to get the idea about the how they actually think for the strategy.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • Date : 2nd June 2020. FX Update – June 2 – Weaker USD. Trading Leveraged Products is risky AUDUSD, H1 The Dollar has remained soft, with risk sentiment in global markets holding up, albeit with a weakening grip. Wall Street finished with modest gains yesterday, while the USA500 is moderately in the negative, and while Asian and European markets have gained, they are up by only a limited extent. US President Trump is weighing military action and imposing curfews in cities across the country in an effort to quell rioting, while there are glass-half-full market narratives arguing that, with many assets having recouped to pre-pandemic levels, there may be less upside potential with most economies across the world not expected to fully recover until such time as there is a vaccine or cure for the coronavirus. Despite the flagging risk-on tone, the narrow trade-weighted USDIndex edged out a new low, at 97.74, which is the lowest level seen since March 16th. EURUSD has remained buoyant, and has breached yesterday’s 11-week high at 1.1155, to trade to 1.1178. USDJPY remained in a narrow range in the mid-to-upper reaches of the 107.00s, which has been the case for about two weeks now. Sterling has outperformed on Brexit-related news, with the London Times reporting that the UK government is expected to signal a compromise on fisheries and “level playing field” trade rules if the EU backs off from its “maximalist” demands on regulatory alignment and fishing access, according to unnamed sources. Cable printed a one-month peak at 1.2555, while EURGBP fell to an 18-day low at 0.8865. AUDUSD edged out a fresh four-month high, at 0.6844. The RBA did the expected and left monetary policy unchanged at its June review today, maintaining the cash rate at 0.25%, while signalling that “the accommodative approach will be maintained as long as it is required.” USDCAD printed a fresh trend low at 1.3507, the lowest seen since March 9th. The Canadian Dollar, like other oil-correlating currencies, remains supported by the ongoing buoyancy in oil prices, ahead of the rescheduled OPEC+ meeting this week, while USOil trades at $36.00 currently. Always trade with strict risk management. Your capital is the single most important aspect of your trading business. Please note that times displayed based on local time zone and are from time of writing this report. Click HERE to access the full HotForex Economic calendar. Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE! Click HERE to READ more Market news. Stuart Cowell Head Market Analyst HotForex Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • Reply to this topic... Skim these - if you can https://www.oftwominds.com/blogmay20/globalization-dead5-20.html https://www.oftwominds.com/blogmay20/cycles5-20.html https://www.oftwominds.com/blogmay20/opt-out5-20.html https://www.oftwominds.com/blogmay20/tinas-orgy5-20.html https://www.oftwominds.com/blogmay20/stocks-fragility5-20.html and if you’re still strong and not  burnt out https://www.oftwominds.com/blogmay20/demand5-20.html https://www.oftwominds.com/blogmay20/social-media-plantation5-20.html
    • Open a new NinjaTrader Brokerage account by June 30th and SAVE on a Lifetime license with a discounted price of only $999! Along with access to the most powerful version of NinjaTrader, you will save even more with deep discount commissions at $.09 per Micro futures contract & only $50 margins. Your Lifetime license includes ALL of NinjaTrader’s premium features: Award-winning order entry including Chart Trader & OCO orders Order Flow + tool set featuring the Volume Profile Indicator – NinjaTrader’s most powerful indicator to date ATM Strategies, advanced Alerting system, auto-close positions for additional risk management & more PLUS all future NinjaTrader platform enhancements are included at no additional charge – for life! Simply fund your new account with the minimum of $400 by June 30th to lock in your savings. Questions? Contact us at 312.262.1289 or brokeragesales@ninjatrader.com. Platform License Discount Requirements: Account must be opened & funded in June 2020 with $400 minimum Discount is applicable to software purchase only 2nd accounts for current NinjaTrader Brokerage account owners are not eligible for platform discounts Futures and Forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or life style. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.
    • Date : 01st June 2020. Events to Look Out for This Week.Geopolitics are back in the picture giving the markets pause and adding another layer of uncertainty to a shaky global outlook. However other than US-China tension, next week the global data dockets are heavy and results are likely to underscore the cratering in global economies this quarter. The calendar includes the US Jobs Report and Monetary policy meeting from RBA, BOC and ECB.Monday – 01 June 2020 Caixin Manufacturing PMI (CNY, GMT 01:45) – The Caixin manufacturing PMI is expected to slightly improve to 49.6 from 49.4 in May. ISM Manufacturing PMI (USD, GMT 14:00) – The ISM index is expected to slip to 40.0 in May from 41.5 in April, compared to a recession-low of 34.5 in December of 2008. Tuesday – 02 June 2020   Interest Rate Decision & Statement (RBA, GMT 04:30) – The RBA meet and are unlikely to move rates below historic lows at 0.25%, as RBA Gov. Lowe is his recent statement repeated that negative interest rates extraordinarily unlikely. RBA will maintain its expansionary monetary policies until progress is made towards full employment and we are confident on inflation . Wednesday – 03 June 2020   Gross Domestic Product (AUD, GMT 01:30) – GDP is the economy’s most important figure. Q1’s GDP is expected to slow down at 0.3% q/q and 1.9% y/y. Unemployment data (EUR, GMT 07:55-09:00) – The German unemployment rate in May is expected to have increased to 6.2% from 5.8%, while unemployment change is expected to have declined to 194K from April’s 373K. Meanwhile, Eurozone’s April unemployment rate should rise to 7.7% from 7.4% last month. ADP Employment Change (USD, GMT 12:15) – Lasts month, ADP report revealed a -20,236k April drop that undershot the -19,520k private payroll decline by -716k. For May a -9,000k drop is seen, since nearly all measures of activity rose in May from a trough. ISM Non-Manufacturing PMI (USD, GMT 14:00) – The ISM-NMI index is expected to rise to 46.0 from 41.8 in April. Most producer sentiment reports should show May rebounds after huge April declines due to mandatory closures, on top of the demand hit initially associated with the pandemic, and the oil price plunge with the OPEC price war, as re-openings are underway in most states. The April drop in the ISM survey was much smaller than the declines seen in other measures, however, and this is why we expect a further drop in May for that measure. Interest Rate Decision and Monetary Policy Statement (CAD, GMT 14:00) – On April 15, the Bank held rates steady at 0.25%, matching widespread expectations. In the next policy statement, the BoC is expected to leave rates unchanged, the Bank of Canada Governor Poloz said is his last interview that negative rates are needed only in extreme conditions. Thursday – 04 June 2020   Interest Rate Decision, Monetary Policy Statement and Press Conference (EUR, GMT 11:45 & 12:30) – Given that Lagarde buried any hope of a “mild” recession, the stage seems set for an extension of the PEPP program in size and duration at next week’s council meeting with an end date next year giving the economy more time to recover and EU aid programs to come into effect. Given that the ECB is no longer putting much hope in a quick recovery it is already clear that with the current time frame until the end of December that would risk a sharp widening of spreads in the second half of the year, when there is also the risk of a second wave of Covid-19 infections. Jobless Claims (USD, GMT 12:30)– US initial jobless claims contracted last week by -323k to 2,123k in the week ended May 23 after tumbling -241k to 2,446k previously. Claims have been declining since surging to 6,867k in the March 27 week. Friday – 05 June 2020   Event of the Week – Non-Farm Payrolls (USD, GMT 12:30) – A -2,200k May nonfarm payroll drop is anticipated, following a -20,527 April collapse, and a -701k drop in March. The jobless rate should rise to 17.5% from 14.7% from April, versus 4.4% in March. Nearly all measures of activity rose in May from a trough just after the April BLS survey week, but the initial and continuing claims data suggest a weaker labor market in mid-May than mid-April. Average hourly earnings are assumed to fall -1.0% with a partial unwind of the April distortion from layoffs being concentrated in low-wage categories. This would translate to a drop in the y/y gain to 6.6% from 7.9%. Labour Market Data (CAD, GMT 12:30) – Canada employment plunged -1993.8k in April, nearly doubling the -1010.7k tumble in March to leave a massive and rapid reversal in the labour market as firms cut jobs as most of the economy ceased to function amid the stay at home orders the began around the middle of March. For May employment should revealed a 4,000k drop in jobs, doubling again last months number. B]Always trade with strict risk management. Your capital is the single most important aspect of your trading business.[/B]Please note that times displayed based on local time zone and are from time of writing this report.Click HERE to access the full HotForex Economic calendar.Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE!Click HERE to READ more Market news. Andria Pichidi Market Analyst HotForex Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • Moar questions how many corps in the SP500, NQ100, etc indexes are "rolling in revenue"?  ie they have more revenue than they did 6 months ago ??  thx.  just askin'       Weekend reading https://consentfactory.org/2020/05/20/brave-new-normal-part-2/   https://www.oftwominds.com/blogmay20/demand5-20.html
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.