InsomiaFX USDCAD Grid Bot - 400%/Year

Hello Traders,

this is my first post so I hope to to be in the right section :8:

I’m new to Forex and EA programming and like to show some results of my first EA. Please have a look at the numbers and let me know what weaknesses you would identify and where I should make improvements. So far the bot makes only 400% per year without compounding in the 3 year backtest.

The drawdown is higher than the start capital but the max drawdown happens much later when all 50 trades max are running. During start trades are added slowly after equity has already increased to avoid a stop out or a call from Miss Margin.

Also is the 25% Modelling quality any bad ? I use M1 data from Yadix.


1 Like

As you say, it is a grid trading system. Simple backtests of such systems are meaningless, because you can easily set up the parameters of any grid trading system so that you get any result that you want in a backtest.

For really testing a grid system, you need a platform that supports multiple tests over parameter ranges, such as walk forward analysis. Only then you can get estimates how robust the system is and within which parameter ranges, like grid size, max loss, and so on, the system can be profitable.

Generally, with a grid trading system you are extremely dependent on luck. The asset must not make any large moves, otherwise your account is lost. That’s why such systems are hard, if not impossible to test. I’ve written a grid system myself, and in a backtest it returns about 2000% per year, but I would certainly not trade it with real money.

Thanks for your feedback, very helpful.

I’m a huge fan of grids and made them for other more simple financial products with nice results.

Its just my opinion, but in Forex the level of luck is the same for grids or chart analysts, as nobody can estimate with more than 50% chance how the market will move within a given time frame. At the end of the day, both systems are equal good or bad.

To prevent a stop out the grid simply hedges all trades once the rates leave the grid range. I use Exness as a broker and a full hedge means a 100% offset with no margin. Very safe. Only loss is swap difference and a limited drawdown which depends on the amount of orders and lot size, thus can be calculated. Once the market moved too far away from the grid range, I can choose to close all orders or sit and wait till the market returns. No harm done.

So any grid needs a well developed safety system, basically every EA should have one but many don’t, thus they fail. I wonder how many ppl don’t even check the last error code after each operation …

Anyway, I setup the grid on 4 demo accounts now, lets see how it plays :slight_smile:

How would you answer the commonly held belief that grid systems cannot be adequately hedged due to the linearly growing profits vs quadratically growing losses? (taken from https://sites.google.com/site/prof7bit/snowball):

“Some people claim to be able to overcome this drawback by simply running the same grid into the opposite direction on the same instrument at the same time, applying what they falsely call “hedging”, but it turns out that this is obviously a fatal fallacy. Naturally you can not hedge a quadratically growing loss on one side with an only linearly growing profit on the other side. Furthermore it turns out that these two superimposed grids on the same instrument, if all orders and market exposure is simply added together you will again end up with the very same grid of limit orders, only this time you have created a grid that will automatically switch net trading direction always to your disadvantage and will always pyramid up the losses, no matter where the market decides to go”

Cheers, Paul.

Sorry for my question, but i am still a forex beginner and english is not my first language
(i already learned how to lose money by manual trading and with EA :34:):

Grid… = martingale? Is this the same? Or can there be the one without the other?
I often read about some “grid martingale” EAs.
And i know what martingale is.
I saw day by day a martingale EA destroy my account. The equity getting more and more little (opened positions with 12 lots…). I deactivated the EA, closed the positions and tried to hedge manually. But it was, according to what monsterer wrote, more or less a “sword strike into water” (french spoke).

So lesson 1 for me: NO martingale, never again! :mad:

No, grid trading is not the same as martingale.

Grid trading is a simple system based on placing pending trades at fixed boundaries around the current price. It collects profits as long as the price always returns to its previous value, and collects losses when the price trends away. As monsterer said, the profit expectancy grows linearly, while the loss expectancy grows with a quadratic function. So at some point the loss will inevitably exceed the profit, wiping your account, just like a martingale system.

This is the C script of a grid trading system:

// helper function for finding trades at a grid line
bool findTrade(var Price,var Grid,bool IsShort) 
{
  for(open_trades)
    if((TradeIsShort == IsShort)
      and between(TradeEntryLimit,Price-Grid/2,Price+Grid/2))
        return true;
  return false;
}
  
function run() 
{
  BarPeriod = 1440;
  set(HEDGING); 
  TimeWait = TimeExit = 500;  
  var Price;
  var Grid = 100*PIP; // grid spacing
  var Current = priceClose();
// place pending trades at 5 grid lines  
// above and below the current price
  for(Price = 0; Price < Current+5*Grid; Price += Grid) {
    if(Price < Current-5*Grid)
      continue;
    if(Price < Current and !findTrade(Price,Grid,true))
      enterShort(0,Price,0,Grid);      
    else if(Price > Current and !findTrade(Price,Grid,false))
      enterLong(0,Price,0,Grid);
  }
}

You can find grid trading systems often on Zulutrade, because they lure followers due to their high win rate.

not really, I mean followers are hardly lured that easily as you say,
there is ranking, there are notifications, there are comments and indicators that alarm us when a trader is kinda, lets say wonky…as well there are other traders worth to follow - daytraders or trend traders…so manu strategies to choose from.

I know of the “ranking” at Zulutrade and had already some discussion with them about this.

Zulutrade ranking is based on the equity curve drawdown. You can often identify martingale systems from the equity curve, but it is difficult to identify a concealed grid trading system. The best indicator is that such a system continues to open trades in the same direction when it is already losing - and if you check the trade behavior of signal providers at Zulutrade, you can see that most in the top ranks behave this way. I think a trader who would go for a good profit/risk ratio instead of maximum number of followers would trade differently.

Sure, after the eventual margin call Zulutrade removes the system, but then the signal provider already got his money and most likely just starts again with the same system under a different name.

apparently you do not know about the ranking…and apparently you havent had an account with it…ranking is based on several factors - trading time (the longer a trader is with the system of course the better), monthly profitability (PnL), cummulative dd, open trades ( and the amount in losing positions), riskiness (which here covers the martingale traders) profitabiltiy ratios, amount of winning vs lossing trades…anyhow all the indicators are taken into cosideration.
Regardless, none serious follower takes into consideration only the ranking and trust it blindely, we all know there are certain limitation, so there are other tools like the advanced search that I for example use in order to find better traders to copy.

Why loss expectancy grows with a quadratic function ? The graph in first post shows a 3 year period where the max number of open trades is always limited to 50 (broker account limit) and the lot size is always 0.01.

The risk is always the same in this scenario, same on day one or after 3 years given the price stays inside the grid range.

Grids like all EAs need security features to rescue the account and stop trading in case of a unforeseen situation. Most EAs in the public don’t come with these life savers.

Example:

  • If Equity is double the balance and now starts to drop by x%, close everything. For example, a 25% drop in equity means to close all orders, stop the grid and enjoy the profits. Readjust the grid, repeat …

  • Orders can be paced in 25 long and 25 buy groups, thus having an automatic hedge. My broker Exness removes the margin if all orders offset each other.

  • In a sudden market change my grid places an emergency hedge to offset everything as the last option. Thus I basically eliminate the chance of a margin call or stop out (broker specific).

I will put two demo accounts on myfxbook soon, so far 20% profits within 2 weeks :slight_smile:

My grid has no fixed steps or width. I backtested fixed grid steps of 1000 ticks, 100, 10 and 1 tick. The 1 tick “net size” turned out to be best as it allows the highest amount of trades, thus gives most profits.

But lets not forget, every grid is different in its design and even a minor difference results in total different profits.

Because a grid will scale into a losing trade once every grid-step, praying that the price will come back around. This makes potential losses quadratic while profits are only linear.

Really not sure how you can hedge that?

edit: I also see that you have no stop loss(!) and a 10 pip profit - you may be suffering from modelling quality difficulties at that levels over a long period. Download Tickstory Lite and get some decent data to back-test with.

Cheers, Paul.

The reason is basically that losing trades stay open and accumulate. So when the price goes steady in one direction, losses grow quadratic. You can find the mathematical proof on the website linked by monsterer. The proof on that website is for an anti-grid system, but works for a grid system as well.

This is of course a generalization, as there are many variants of grid systems. For instance, when you close losing trades early, you limit the losses, but of course the profits as well.

Anyway, I wish you luck with your system, as that’s what you’ll need. I know two people who followed systems on Zulutrade that were probably grid trading variants. One got his account wiped out after a year, the other one a little later.

  • Edit: Oops, monsterer was faster responding.

JUST because you know two out of the general population inhabiting as followers on zulutrade, doesnt give you the ground to make generalization upon that. A LOT OF FOLLOWERS are actually winning and with ‘grd trading variants’ you are mentioning. the good part is that traders trade, they do their tech analysis, and macro - investigations and calcualte the exit/entry points, and we followers decide on WHAT and HOW to follow - meaning little number of trades and lots allocated, and lets go more advanced - can reverse trades and even place stop/loss level of our own, should we think appoprate. The account management is totally up to us - because of this openness this is the reason why the platfrom is that damn popular, imo. if you dont expose your account to risk and stay within a Margin-o-meter of bello 100% returns are sweet and easy to gain - always talking as a follower, as a trader/signal provider things are more complicated and i have no eperience to talk about.

You seem to be a heavy defender of Zulutrade, and you certainly have a point - one can not make generalizations from knowing two people who lost their money with Zulutrade.

According to Zulutrade, there are about 55 followers who have NOT lost money. Those lucky 55 are listed on their Top Followers list that you can check out here: Best Social Forex Traders | ZuluTrade Social Forex Trading (click on “Followers”). Their profits range from 800% at the top of the list, to 0% at the end at rank 55. So we can assume that all followers below rank 55 have either lost money, or are not long enough at Zulutrade to appear on their list.

When you consider that Zulutrade has about 85000 followers - at least that’s the number of users on their forum - we can calculate a probability of 55/85000 = 0.07% of NOT losing money in the long run with Zulutrade.

When you consider that by trading randomly your chance to not lose money is only slightly less than 50%, you have to conclude that most Zulutrade signal providers use high-risk systems, such as grid trading or martingale, that almost guarantee a loss in the long run.

Heavy deffender only when i read unrealistic comments, of course! when it comes to flaws i am also the first one to comment.

the performance page shows only followers that wish their accounts to be public - this others to cope their settings. Myself and my 4 accounts are not among these - for several reasons and i’m sure there are others like me as well. forum has nothing to do with the users, i mean most of us have multiple accounts, or some never use the forum as well.

anyhow, i remember the list being more that 55, maybe there is some new feature with the new website; regardless, have you had an account with zulutrade ? i mean you go to critisize/comment something that you already know that you already have used, not by some out of there applied math calculations…

anyhow happy pipping with your trading mate, we all have our ‘system’ and methods how to do things.

I never knew that there is an option in zulu that enables your public profile lol. I have mine disabled btw by default, never really bothered with my profile page ,maybe i will now that i know about it. So i guess eddi is right , those 55 might be the only users that know about the public profile option.

Not to be nitpicking, but do you really think that from all the 85000 followers, only 55 enabled public trade results although Zulutrade gives them pips when others copy them? It seems obvious that there is another reason why Zulutrade can show only 55 surviving accounts.

Even from those 55 survivors, when you look into their equity curves, you can see that many have lost money or deactivated their account. Surviving Zulutrade for a longer period, like 1…2 years, seems to require either extreme luck or leaving in time.

you are nagging without making quite sense …i doubt we are only 85K …I will give you only one number : 488.8B USD in live account transactions…obviously the number is quite live…what they post as live followers that want to be followed doesnt really matter much…i’ve been making for more than 15m gains with the platform and the only ‘luck’ that made me survive is being risk averse or lets say LOSS averse - meaning trying to scalp as much winning possitions of my providers as possible. Sadly enough, i am actually wasting my words here with you, as you dont even have a live account with it, should it be the opposite you would have an exact idea of what i am saying here.

Care to read my post and give a coherent answer? For instance, why can they show only 55 accounts that survived Zulutrade for two years? And why have many even of those 55 surviving accounts lost their money or are not trading with Zulutrade anymore? And why are the displayed ROI figures obviously wrong - far too high - when you compare them with the account equity curves?