Can someone build this EA for me (Enter trade when there is a one 5mins bar close below or above a trendline) - page 2

 
Wow, so that's what this program is trying to do. I didn't even know mt4 could change stop-loss and take-profit with mouse dragging. Sorry, this is Definitely something I Don't have the Ability to code for you. Your code looks very nice tho, seems you've been coding since 2006. I just started a Month ago.
 
ubzen:
Wow, so that's what this program is trying to do. I didn't even know mt4 could change stop-loss and take-profit with mouse dragging. Sorry, this is Definitely something I Don't have the Ability to code for you. Your code looks very nice tho, seems you've been coding since 2006. I just started a Month ago.

Its very possible Ubzen, attached below is an EA that changes stop loss and take profit by mouse dragging.

Since i already have an EA thats does the stop loss and take profit dragging, can you build the other parts of the EA for me as in the trendline breaking aspect?

Franklin

Files:
 
franklinadamau:


Hi V thanks alot and im really grateful for your immense support,

Uploaded is the edited version i tried to edit myself just as you told me but im sure i got the whole thing wrong cos it wouldnt even run, right now i think i need to focus on how to make my trading system better then il learn how to code and build EA's later in the nearest future cos i know for sure that its also very important for one to be a profesional trader. Could you plz help me code the EA by editing it to my own taste....Hope you will understand.

Franklin


Not sure what you did with the edit, but it wasn't "just as as you told me" You didn't change the shift to 1, you didn't change the ask to iclose, you changed a string to read "close" and deleted 16 lines... not sure why... Ditch the edit and go back to the beginning.


There are 4 places in the code with the word Ask and 4 with the word Bid. They all need to be exchanged with iClose(NULL,0,1). This will enter your order when the close of the last complete bar of the time frame you are running on.


There are 3 variables that get set in 2 places. 2 each of variables vH,vM and vL. eg

vH = NormalizeDouble(ObjectGetValueByShift("High"+BuyStop_TrendName,0),Digits);

The current shift on these variables is 0 which means the current bar. If you change the 0 to a 1, it will give you the value for the last fully completed bar, thereby matching the time frame for your close. And for avoidance of doubt, it should look like this...

vH = NormalizeDouble(ObjectGetValueByShift("High"+BuyStop_TrendName,1),Digits);

You will need to run this on a 5 minute chart if you want the 5 minute close.


Presumably you can't back test this, given that you need to draw a trendline so you are not going to know if you have been succesful until the market opens again.


Also, you realise that this code is setting pending orders rather than market orders and the pending orders are based on a distance from the line. There may be many problems with waiting for the close of the 5 minute bar if that price gets to close to where you are setting your buy limit and the order may fail.

Just an observation
V
 

These programs you're providing have Copy-Rights. I'm not familiar with copyright laws, therefore, I'm not going to modify those EA's. Obviously, the correct 1st attempt to take would be to contact the original coders and ask them for expansion. You may have already done this and proved un-fruitful. Viffer, brought up some interesting points, some of which came to mind when I taught about coding your EA from scratch.

 

- How do I force 5-Minute close time frames on any charts. If you are a manual trader and drawing your own Resistance/Support and Trend lines, chances are you're zooming in different time frames all the time.

 

- How do I make the program search for and trade off Objects. And how do I differentiate the Objects. If you draw more than One trend line, which is the program going to trade off. The Mouse stop-loss is another example.

 

- Why does the ea use pending orders oppose to market orders. What if the lines are drawn too close to current price action.

 

- How am I suppose to test this over the Weekend as the markets are closed. For some odd reason my demo account stopped working of Friday, I need to figure out what's happening there.

 

Now all of the above are very do-able as I'm one of those people who believe anything can be programmed. Your EA's are living proof of that and provide good examples. However, I'll have to study the codes before writing your EA because I haven't had to do these things before. The ball goes back to you learning how to Code yourself. However, you definitely showed me some possibility in terms of Coding.   

 

There is an extern string that seeks the name of the line so presumably once the line is drawn, you either name it as per the EA or change the extern to match. The forcing to 5 min from any chart is a different matter though. Working on say 1H and wanting the 5min close is far trickier. the shift of the line value will shift back 1 hour so no good. probably best to just take the current value and leave the shift at 0 if this is the case. The biggest problem I can see is, as you've acknowledged, a 5 minute close may take you well into the bands of too close to price action and fail. I'm anticipating another post next week asking what Error 129/130 is. (I'm not sure which one it will be).

Presumably the code is not authored by OP, none the less, I found it intriguing code as I have never done anything like that before myself. All adds to the knowledge base :)

V

 

hi V and Ubzen, thanks a millions for at least showing concern and im really garteful. Iv started learning how to code from the scratch and i think the links that V gave me will be very helpful.

I believe we learn every day and perhaps we are going to learn alot trying to code this EA.

Lets keep trying.

Im editing the first post to make my request specific perhaps more people will add their comment which in turn may be very helpful.

Franklin

Reason: