PipMaker v1 - Price action based EA - page 3

 

Version 3

I will post the EA to the first post.

Here is the updates explained...

1. Changed Boost to an extern bool and made it true. This allows multiple trades per candle and not just on the opening of the candle.

2. TrendSpacing - This is a separate spacing increment for when the price is higher than the highest buy or lower than the lowest sell. It allows the profit to accumulate quicker when in a trend.

3. CounterTrendMultiplier - This multiplies the lot size to help the retracements accumulate profit quicker. Set to 1 if you want the lot size to stay the same.

4. In the CheckForBuy() and CheckForSell() routines, I broke up the entries into two separate subroutines. This allows for the TrendSpacing and CounterTrendMultiplier.

5. I also added a MidPoint line for a visual aid. It has no real purpose.

6. Simplified the right side label to incorporate the margin and low margin and balance into one label.

Still having problems with the losing orders closing improperly. Still working on it. Can still use some help on it!

Don

EDIT - I didn't get the LWMA added to this version. Maybe in the next one.

 

Okay.... found a few things that needed attention and tidied up the source a little in the process.

Main things were:

1) removed a couple of redundant variables

2) added RefreshRates() at appropriate points

In CheckForBuy() & CheckForSell():

1) added a check for zero lot sizes

2) commented out the "for loops" around the calls to OrderSend() as I couldn't see what they achieved

In Start():

1) added checks for HighestBuyTicket, LowestBuyTicket, HighestSellTicket & LowestSellTicket being zero before trying to select/close the distant order

I've run a quick test from Sept 06 to June 07 and no errors are now being reported either for opening or closing orders. In the test, as a batch of SELLs was closed at a profit, the most losing BUY was also closed and vice-versa.

Obviously, some more checking would be good, just in case I've missed something but the updated source is here.....

Files:
pipmakerv3a.mq4  20 kb
 
Neo:
Okay.... found a few things that needed attention and tidied up the source a little in the process.

Main things were:

1) removed a couple of redundant variables

2) added RefreshRates() at appropriate points

In CheckForBuy() & CheckForSell():

1) added a check for zero lot sizes

2) commented out the "for loops" around the calls to OrderSend() as I couldn't see what they achieved

In Start():

1) added checks for HighestBuyTicket, LowestBuyTicket, HighestSellTicket & LowestSellTicket being zero before trying to select/close the distant order

I've run a quick test from Sept 06 to June 07 and no errors are now being reported either for opening or closing orders. In the test, as a batch of SELLs was closed at a profit, the most losing BUY was also closed and vice-versa.

Obviously, some more checking would be good, just in case I've missed something but the updated source is here.....

67 errors, 54 warnings

 

That'll teach me to make changes in an editor without recompiling first

As is often the way, it was a single closing bracket that I thought I'd removed in the clean-up so here is the tested version...

Files:
 

Still getting 67 errors, 54 warnings

 
fxnewbie:
Still getting 67 errors, 54 warnings

This one compile fine.

Files:
 
Michel:
This one compile fine.

Tks. a lot, Michel

I will try.

 

Sorry fxnewbie - sure I'd uploaded the fixed version but perhaps not.

Guess that's what happens when you're coding at 4am

 
Neo:
Sorry fxnewbie - sure I'd uploaded the fixed version but perhaps not. Guess that's what happens when you're coding at 4am

Not to worrie, mate

Your efforts are much apreciate.

 
Neo:
Okay.... found a few things that needed attention and tidied up the source a little in the process.

Main things were:

1) removed a couple of redundant variables

2) added RefreshRates() at appropriate points

In CheckForBuy() & CheckForSell():

1) added a check for zero lot sizes

2) commented out the "for loops" around the calls to OrderSend() as I couldn't see what they achieved

In Start():

1) added checks for HighestBuyTicket, LowestBuyTicket, HighestSellTicket & LowestSellTicket being zero before trying to select/close the distant order

I've run a quick test from Sept 06 to June 07 and no errors are now being reported either for opening or closing orders. In the test, as a batch of SELLs was closed at a profit, the most losing BUY was also closed and vice-versa.

Obviously, some more checking would be good, just in case I've missed something but the updated source is here.....

I have never used the RefreshRates() before. The for loops was doing that. at least attempting to do that...

I ran backtests from '04 and in July of '04 the errors still occurred. I will look closer at the code and see if I can find anything.

Don

Reason: