Featured Martingale EA to explore and expand, provided by a programmer - page 5

 
forextan:
Christina & Joe,

Thanks for the effort and sharing. Have you try the CL-martingale with MACD in demo account? I try it with the demo account, no trade is trigger for almost two days.

By the way, do you have any EA that will close all trade and disable the EA after certain amount lost? I found some EA which the function only close existing trade and delete all pending order, but the EA still enable. Which mean the EA will trigger another trade again, so the lost might continue if the trend keep against us.

Thanks.

Regards,

Eric

Most likely your "Threshold" and "HL_Limit" settings are too high for the time frame you are trading with. You can watch the definition of those in my video.

In short the entry logic for sell is this: If MACD makes a high point (has to be higher than the HL_Limit) and then drop a certain value (Threshold) then we consider the trend is turning down.

The function you are asking is not that difficult to code, either need to track the total loss from current EA or entire account.

 

I have tried the EA in 1H chart with default setting, Is the default setting work fine for 1H chart? Let me try on other broker's demo account and update later.

The function that I'm looking for, definitely is not difficult to experience programmer like you. I have tried to use EA builder software to create this function, already two weeks but still no clue. Would you mind to create a basic one to share. Just track the lost (allow to adjust) and close all trade and pending order, then remove the EA (or disable the Expert advisors button).

Understand you are in busy schedule now, just help if you are really free and have time. Thanks in advances and enjoy your weekend.

Regards,

Eric

 

Hey Eric - Christina,

I've been looking for the code myself on how to get an EA to terminate. I've got the code for Close All Orders (pending and open), but like you said Eric, it still keeps on trading after it closes the orders at a pre-determined Equity drawdown.

I'm running the original CL on live demo, and it's trading fine. I expect with the MACD version and running H1 charts, it may take a while before it sees a good entry condition. Just for test, try it on M1. At least that will tell you if it's firing off the MACD.

If I find the code for terminating a strategy, I'll post it. I know Christina could do it with her eyes closed, but this might help us learn a little more about coding ourselves. I'm brand new to MT4 programming to and it's been "trial and error" for me so far getting an EA to actually work!! My biggest frustration is trying to find WHERE to put it in the strategy logic.

Anyway, that's my task for today, to work on finding a way to make a strategy terminate.

Joe

 

very good

Christina and others,

Thanx so much, this is very close to exactly what I've been trying to get other semi-martingale and grid systems to do for almost a month now. My idea was to let it martingale for a while, buy and sell, to a certain point, and number of sequences, then stop it, take the money and run, stop it right where it is, close out all pending orders, and buy/sells that are ranging, also making sure you're not close to the margin, and start it again after everything calms down, which is pretty much what you're doing, except you're way ahead of me. One idea you might add, in your (say buy) sequence, is to put a time limit on it. If the trade doesn't advance (say 10 pips) in two hours, or so, just shut down the whole gizmo. and start it again, so it becomes like a modified version of some of those offlne ea s that don't depend on time.

It seems to me that the whole thing can be done with the highly modified martingale method. The idea of adding indicators might be good, but I haven't gotten that far yet.

Your idea of just using one side (like buy) at a time is very interesting, maybe better than my idea, but, again, I haven't gotten that far yet.

Thanx so much, this is really great.

 
forextan:
I have tried the EA in 1H chart with default setting, Is the default setting work fine for 1H chart? Let me try on other broker's demo account and update later.

The function that I'm looking for, definitely is not difficult to experience programmer like you. I have tried to use EA builder software to create this function, already two weeks but still no clue. Would you mind to create a basic one to share. Just track the lost (allow to adjust) and close all trade and pending order, then remove the EA (or disable the Expert advisors button).

Understand you are in busy schedule now, just help if you are really free and have time. Thanks in advances and enjoy your weekend.

Regards,

Eric

Hey Eric,

I've started a thread here: https://www.mql5.com/en/forum/173219/page184

I don't want to clutter up Christina's thread. I posted my test EA. The EA will stop trading if it hits a daily profit goal, but starts trading again the next day. Maybe we can adapt that code somehow.

Christina, this might be a nice feature to add to CL Martingale sometime in the future.

Joe

 

td lines

Christina and others.

In my opinion, there is nothing like the Tom Delay lines to predict the extent of a trend. If you could code this in, it would be great. td lines not only predict the direction of a trend, they predict the length of a trend. So, with your great idea about taking a (say a buy) in one direction, with x amount of trades at 10 pips each, or, etc., would work perfectly with this indicator. I'm sure you know about it, but here it is:

Tom demark Trendlines @ Forex Factory

 
Trade1953:
Hey Eric - Christina,

I've been looking for the code myself on how to get an EA to terminate. I've got the code for Close All Orders (pending and open), but like you said Eric, it still keeps on trading after it closes the orders at a pre-determined Equity drawdown.

I'm running the original CL on live demo, and it's trading fine. I expect with the MACD version and running H1 charts, it may take a while before it sees a good entry condition. Just for test, try it on M1. At least that will tell you if it's firing off the MACD.

If I find the code for terminating a strategy, I'll post it. I know Christina could do it with her eyes closed, but this might help us learn a little more about coding ourselves. I'm brand new to MT4 programming to and it's been "trial and error" for me so far getting an EA to actually work!! My biggest frustration is trying to find WHERE to put it in the strategy logic.

Anyway, that's my task for today, to work on finding a way to make a strategy terminate.

Joe

Hi Joe,

Yes, I have tried the original CL on demo account and it works fine, but I tried "CL with MACD indicator" has no trade for two days on H1 chart. Thanks for your advise and I will try on M1 chart next week to see if it works.

Thanks for the your effort to find the code for terminating a strategy. I will post it as well if I manage to get one. By the way, the link of your new thread is not working for me. I click the link but nothing has post in your thread.

Eric.

 
forextan:
Hi Joe,

Yes, I have tried the original CL on demo account and it works fine, but I tried "CL with MACD indicator" has no trade for two days on H1 chart. Thanks for your advise and I will try on M1 chart next week to see if it works.

Thanks for the your effort to find the code for terminating a strategy. I will post it as well if I manage to get one. By the way, the link of your new thread is not working for me. I click the link but nothing has post in your thread.

Eric.

Hey Eric,

Somebody moved my post and put it under How To Code, along with a couple of thousand other posts. Here's the link of where I found it https://www.mql5.com/en/forum/173219/page184 but I don't guarantee that link will work either. But, we'll probably never get a response since it burried so deeply in the How To Code thread.

Joe

 

trying to explain.

I'm still not making myself clear. I'd like to have the ea so I can stop, clear all open trades, and reverse manually, when the trend changes.

I like to use the Tom demark lines in order to do this. They do a good indication of the direction and estimated length of the trend.

I'd rather not use the rsi, etc., nor any overbought, oversold indicator. I can see manually, when a trend is changing, or about to change.

The way you have it coded now, if your primary order is buy, and you enter 10 orders, it has to close one order out, before you can change it from buy to sell.

I think your idea of martingaling in one direction is a fairly good idea, it's workable, but, I'd like to be able to change the primary direction at will.

Overall, its a beautiful concept that you have here.

My idea makes a lot more sense when you use multiple charts on one platform.

Thank you.

 

I'm o.k. now

I can see that I can do pretty much all I want to do manually as well. As far as closing positions and reversing them when the trend changes.

So, o.k., great, this is a great system. All I have to do now is to keep my wits about me and use the ea right

Thank You

Reason: