Why is there NO Complete EA within the Code-Base? - page 2

 

I am a bit worried about sharing my custom indicators and EAs because if I did and everyone started using them they wouldn't work any more... Does anyone else agree?

I know this sounds a bit selfish... but when I get to 5 million I will share ;-)

 

Not true.

The forex market is the exact place where you WANT to be doing what the majority of players in the market are doing. For a long time I didn't undertand that and wanted to invent warm water where there was no need. Turned out I needed a friend to point out to me - why piss against the wind?

It turns out that if you're sure that every1 in forex will be doing what you're doing, you want to do that thing as market will surely move your way. (tl;dr if everyone goes long in the world, you want to go long :) and vice versa).

However. I don't think the OP invited us to disclose our working indicators and EAs, that we (indeed) have invested our time and money to create. What he meant was that the Documentation, Book and Article section were not thorough enough and didn't explain EVERYTHING that a MQL4 programmer should know. In order to improve that OP suggested that we share our basic code snippets - the way we handle orders, disconnects, string manipulation, number manipulation.... Basic things that every one of us otherwise codes for himself.

On the first page WHRoeders posted his base file. It's awesome. Take a look into it. It basicaly nullified the need for ME to post or share anything :) there's more stuff in there than most of us need.

 
mbirrell:

I am a bit worried about sharing my custom indicators and EAs because if I did and everyone started using them they wouldn't work any more... Does anyone else agree?

I know this sounds a bit selfish... but when I get to 5 million I will share ;-)


That's why you Scrip out the trade logic or provide average systems. Complete EA is not about giving people will-be-profitable EA. Profitable EA's can suddenly turn un-profitable and vice-versa. I'm usually very motivated when working on EA's for the masses than for myself. The only other mindset which motivates me more is when I'm being paid to write EA's. However, I wouldn't be comfortable charging people for coding unless I could code a Standard EA.

The problem I have when trying to contribute something to the code-base is making the program Universal Enough. Like 4 vs 5 digits brokers. Not assuming I'm the only EA they're using etc. Tho, I haven't implemented All the standards to my own EA(s), I cannot in good faith overlook obvious problems because I'm aware of em.

 
ok well here is a snippet of code that works very well for me. It displays the average true range of a moving average - just like the regular ATR indicator it detects sudden changes and also if the trend line is trending.... Just edit the section of the ATR code that calculates ATR with this: Also put this under AtrPeriod: extern int MA_AtrPeriod=20;
i=Bars-counted_bars-1;
   while(i>=0)
     {
      double high=iMA(NULL,0,MA_AtrPeriod,8,MODE_SMMA,High,i);
      double low =iMA(NULL,0,MA_AtrPeriod,8,MODE_SMMA,Low,i);
      if(i==Bars-1) TempBuffer[i]=high-low;
      else
        {
         double prevclose=iMA(NULL,0,MA_AtrPeriod,8,MODE_SMMA,Close,i);
         TempBuffer[i]=MathMax(high,prevclose)-MathMin(low,prevclose);
        }
      i--;
     }
 
forexCoder:

Not true.

The forex market is the exact place where you WANT to be doing what the majority of players in the market are doing. For a long time I didn't undertand that and wanted to invent warm water where there was no need. Turned out I needed a friend to point out to me - why piss against the wind?

It turns out that if you're sure that every1 in forex will be doing what you're doing, you want to do that thing as market will surely move your way. (tl;dr if everyone goes long in the world, you want to go long :) and vice versa).

However. I don't think the OP invited us to disclose our working indicators and EAs, that we (indeed) have invested our time and money to create. What he meant was that the Documentation, Book and Article section were not thorough enough and didn't explain EVERYTHING that a MQL4 programmer should know. In order to improve that OP suggested that we share our basic code snippets - the way we handle orders, disconnects, string manipulation, number manipulation.... Basic things that every one of us otherwise codes for himself.

On the first page WHRoeders posted his base file. It's awesome. Take a look into it. It basicaly nullified the need for ME to post or share anything :) there's more stuff in there than most of us need.


Some insist that in retail forex you are in a closed market consisting only of those trading in retail forex, and that for every long position there must be an opposing short so if everyone was to trade the same way you would not get your order filled as there would be no one to take the opposing position or as is more likely, if a large majority were to trade the same way you would get big requotes.

 

> Some insist that in retail forex you are in a closed market consisting only of those trading in retail forex

This could be true on a 'dealing desk' broker, where the broker forms his own 'internal market' and is always positioned against the retail guy
However, I'm not aware of any mainstream broker that is still 'dealing desk'..?

And no we're not naming names here, so lets not start discussing individual brokers, just be aware if yours is 'dealing desk' or not!

-BB-

 
SDC:


Some insist that in retail forex you are in a closed market consisting only of those trading in retail forex, and that for every long position there must be an opposing short so if everyone was to trade the same way you would not get your order filled as there would be no one to take the opposing position or as is more likely, if a large majority were to trade the same way you would get big requotes.


I read it. It's like Newton's sedond law in forex.

But this also means that if all the people tried to go 1 way, the task would be impossible, but the DEMAND for it (all those people would mircoulosly want to go either long or short) would create either an infinite price in that commodity (going long) or zero price (going short). Either way it's a market crash, something we do not want, but I take this borderline example as a basis for my theory, that I always want to do what the majority of players (in trading volume, not headcount) wants to do.

 
WHRoeder:
Here's mine minus the actual trading logic.
Hi William, hope you don't mind, I've been looking through your code today and have a question.

If I understand correctly you keep track of the equity at risk ( ModifyStops() ) not only for the chart where the EA is placed (chart.at.risk) but also for all orders placed on all charts (equity.at.risk) ? In the calculation of the equity you use a variable called perLotPerPoint this comes from a function PointValuePerLot(), looking at this function it only works on the current chart symbol . . . so I'm a little confused how equity.at.risk can be correct ?
 

Nice catch. Obviously PointValuePerLot() isn't right for other pairs and the calculation can't be correct.

The idea was to avoid margin calls when opening multiple trades (ie grid trading). Calculation result is used in LotSize() with AccountFreeMarginCheck()

This expanded to same pair/other time frames and then to other possible pairs.

Passing the symbol fixes the function and the variable is no longer a constant so must be inside the loop.

 
Great, thanks for the confirmation.
Reason: