Jump to content

(REQ Plz) Simple Take Profit EA based on Bollinger Bands


Recommended Posts

  • Replies 274
  • Created
  • Last Reply

Top Posters In This Topic

http://www.multiupload.com/XODK88ZDIF

 

Ok guys, here is the next edition, this time being able to handle multi-currencies. That one was bit of a curved ball but I think I ironed out some of the problems.

 

Benny, good reporting, that is exactly the kind of info I need in order to track down problems.

 

cheers kenny

 

I will test when market re-opens

Edited by benny3
Link to comment
Share on other sites

Hi Kenny i'm still testing but everything seems to be working alright , i'm just alittle worried about the stops that the expert puts in....

I waited for about 10 minutes when i opened 2 trades and it never put in any stops... but i was too tired and went to sleep, and woke up the stops were put in.. soo that was good but it took too long, maybe thats normal and i can work around it. cheers

Link to comment
Share on other sites

Ok Kenny here is my tests, I opened 4 Trades 1 on the USD/JPY 2 on the EUR/JPY 3 on the GBP/JPY and 4th on the AUD/JPY. And still there is no stoploss, i'm not sure if it's because i'm trading the same currency or what, they all have JPY in them. Here are some pics that can hopefully help.

 

http://i36.tinypic.com/33cxgci.jpg

http://i33.tinypic.com/23msjlv.jpg

http://i37.tinypic.com/2hd4due.jpg

http://i34.tinypic.com/29mao79.jpg

http://i35.tinypic.com/29ksuo1.jpg

http://i36.tinypic.com/fp09lg.jpg

http://i35.tinypic.com/2pq4xtj.jpg

 

am i doing something wrong?

Edited by benny3
Link to comment
Share on other sites

Hi Benny, it must be something that we are missing, since I honestly cannot reproduce the error. It will work with all 2/3/4/5 digit brokers/instruments.

 

Please can you show me a screenshot of the Experts tab.....maybe there is something there?

 

Sorry Kenny i had removed the expert and when i did that i lost all the last trades information. i will keep you posted

Link to comment
Share on other sites

Hi Kenny i'm still testing but everything seems to be working alright , i'm just alittle worried about the stops that the expert puts in....

I waited for about 10 minutes when i opened 2 trades and it never put in any stops... but i was too tired and went to sleep, and woke up the stops were put in.. soo that was good but it took too long, maybe thats normal and i can work around it. cheers

 

Hi,

 

Me G/J, U/J SL OK! (Alpari UK)

Sorry, I no english.

Thank you Kenny and benny!!!

Link to comment
Share on other sites

No problem. What is clear from the journal is that no order to modify the trade is being sent so, for some reason, the EA is not instructing the terminal to send the instruction. As matter of interest, this is the relationship between the journal and the experts tab. Experts tab tells you what is happening between your EA and the terminal. The journal covers everything between your terminal and your broker.
Link to comment
Share on other sites

No problem. What is clear from the journal is that no order to modify the trade is being sent so, for some reason, the EA is not instructing the terminal to send the instruction. As matter of interest, this is the relationship between the journal and the experts tab. Experts tab tells you what is happening between your EA and the terminal. The journal covers everything between your terminal and your broker.

 

i've got to go to work now but i'll test again when i get home thanks a bunch for help Kenny

Link to comment
Share on other sites

http://www.multiupload.com/JUL19GLG3F

 

Herewith the latest edition. This is still very much a work in progress so bear with me.

 

I have included a nifty little routine that will automatically calculate your SL_Buffer based on currency pair and timeframe. By way of example, you could use a buffer of 15 pips on the EURUSD, but that would not be enough for the GBPJPY which seems to jump twice as many pips with each tick. The Buffer should also be bigger if you are going to trade a D1 TF than on M15 TF. The buffer increases as the squareroot of the ATR(20). Select SL_Buffer to -1(default) to use auto calculate, or just enter any other value(positive) you please and it will be disabled, using your value instead. Ideas on what the correct target values should be are welcome and we can fine tune it.

 

I have also got it to draw a TP line at the middle bollinger band so you can see the target.

 

Some minor bugs fixed here and there.

Link to comment
Share on other sites

http://www.multiupload.com/JUL19GLG3F

 

Herewith the latest edition. This is still very much a work in progress so bear with me.

 

I have included a nifty little routine that will automatically calculate your SL_Buffer based on currency pair and timeframe. By way of example, you could use a buffer of 15 pips on the EURUSD, but that would not be enough for the GBPJPY which seems to jump twice as many pips with each tick. The Buffer should also be bigger if you are going to trade a D1 TF than on M15 TF. The buffer increases as the squareroot of the ATR(20). Select SL_Buffer to -1(default) to use auto calculate, or just enter any other value(positive) you please and it will be disabled, using your value instead. Ideas on what the correct target values should be are welcome and we can fine tune it.

 

I have also got it to draw a TP line at the middle bollinger band so you can see the target.

 

Some minor bugs fixed here and there.

 

Hi Kenny is it ok if you can remove the tp line for the center Bb and just have it only for the outer bb only. And also i'm only going to be trading the 4hr charts only with 20 pips above high or low. cheers

Link to comment
Share on other sites

so in summary

 

I'll enter a trade the EA will put my stop 20 pips above or below high or low, then if price reaches the center BB it'll take half the position, and the rest will be taken at outer BB, and can the tp of the center and outer BB move with the Bb cheers kenny

Link to comment
Share on other sites

so in summary

 

I'll enter a trade the EA will put my stop 20 pips above or below high or low, then if price reaches the center BB it'll take half the position, and the rest will be taken at outer BB, and can the tp of the center and outer BB move with the Bb cheers kenny

 

Yup, thats what it does. The EA uses a market order to execute the partial close, which was the reason behind the yellow TP line. It shows the user that the EA is doing something. When the middle BB is hit, half the order is close, the SL brought up to the entry price(BE) and the TP is set at the opposite BB. This TP is changed every time the bar changes.

 

BTW auto SL_Buffer works out to 22 pips on the H4 for GBPUSD and 28 pips for GBPJPY.

Edited by kennyhubbard
Link to comment
Share on other sites

Hi Benny,

 

To remove the line, just select black as the color of the TP line in the external parameters. Also if you want 20 pips, just enter that in the SL_Buffer and it will use 20 pips.

 

thanks kenny how about multiple trade opening? i'll test when i get home, just at work at the moment. oh and what broker are you with?

Link to comment
Share on other sites

Hi Benny,

 

I hope that the multiple trade issue is resolved but it is only in real battle testing that we will find out. There are always going to be discrepencies here and there. I do a lot of coding on FXOpen and I discovered today that their platform's market info does not give the correct minimum lotsize. This produces errors in the EA if you are trading a lotsize at minimum volume since the EA will try and close half of that which is not allowed..........sigh!!

 

Also I am not at all confident that all MT4 brokers use the same approach to partial closing ie making a new ticket for the remaining trade......unfortunately the information on this kind of thing is limited and we have to collect it by trial and error.

 

Anyway, I trade live with JadeFX, MB Trading and I am working on getting an account with TheCollective FX. I do most of my coding on the FXOpen platform in order to eliminate the chances of me entering trades by mistake on one of my live accounts.....I have done it before.

Link to comment
Share on other sites

http://www.multiupload.com/6BP5HAFJQ3

 

Hi Benny,

 

Sorry about that, I found the bug. Attached is the corrected version. If you set the SL_Buffer to 20 it should do the SL buffer at 20 now.

 

Quick question about the moving TP. It currently uses the BB of the close of the previous bar, so therefore it only updates the TP every new bar. Are you happy with it this way or do you want it to change the TP on each tick based on the current bar BB?

Link to comment
Share on other sites

http://www.multiupload.com/6BP5HAFJQ3

 

Hi Benny,

 

Sorry about that, I found the bug. Attached is the corrected version. If you set the SL_Buffer to 20 it should do the SL buffer at 20 now.

 

Quick question about the moving TP. It currently uses the BB of the close of the previous bar, so therefore it only updates the TP every new bar. Are you happy with it this way or do you want it to change the TP on each tick based on the current bar BB?

 

Hi Kenny thanks very much for fixing the stoploss issue,i'll test it when i get home.

 

with the tp, can i have it updated every tick not every close of the bar cheers

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...