Semi-auto trading aide

User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Semi-auto trading aide

Post by SteveHopwood »

niekes emailed me over the weekend, asking for what he describes in this post: http://www.stevehopwoodforex.com/phpBB3 ... 415#p21415

This EA is a semi-automated aide to manual trading.

I thought straight away of the 'Waiting to Buy/Sell' ea's that I have waiting for a price to cross a pivot on my 10.2 charts, and how this might be a useful addition to the armoury. The problem with this sort of ea lies in coding so that it knows when to stop.

I have tackled this one a little differently. Drag the attached script onto a chart and it will draw three lines:
  • - yellow, dashed line.
    - green and red dotted lines.
The yellow line is where you want your pending trade. You adjust this manually, then adjust the green dotted line to your take profit and the red to your stop loss.

Yellow is my default for NeutralLineColour. If you drag the attached ea onto the chart, it will do nothing. If you delete the yellow line, the ea will never do anything - it must have the line on the chart, set to the correct colour first.

If you want a buy stop trade, select the yellow line and change its colour so it matches BuyLineColour - green by default. For a sell stop trade, change the colour to SellLineColour - default is red.

The ea and script have a set of inputs common to both:
  • BuyLineColour=Green;
    SellLineColour=Red;
    NeutralLineColour=Yellow;
    PendingLineName="Pending trade line";
    TakeProfitLineName="Pending Take profit line";
    StopLossLineName="Pending Stop loss line";
If you change a colour in the script, make sure you change it in the EA. Ditto any of the line names. If the ea fails to find the lines it needs, in the colours it needs, it can do nothing.

Assuming all is well, the ea will send a pending trade at the price indicated by the pending trade line, with sl/tp set to the values of the red and green dotted lines. Once the trade is sent, the line changes back to its neutral colour to prevent further trading.

From here, the ea monitors the trade. When it finds the trade has closed, it examines your trade history:
  • - if the trade closed at a loss, the ea resends the pending trade. If you happen to be watching, you will see the colour change briefly to its pending trade colour.
    - if the trade closed at a profit or at breakeven, the ea will delete all the pending lines and can do no more.
PendingTradesExpiryMinutes allows you to send an expiry time with your pending. To expire after one hour if not filled, this would be 60 etc. The default of 0 means, no expiry.

Much of the rest is well-trodden territory by now. I have removed the swap and balance filters. There are the usual management features.

:D
You do not have the required permissions to view the files attached to this post.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
niekes
Posts: 6
Joined: Mon Aug 13, 2012 10:51 am

Re: Semi-auto trading aide

Post by niekes »

Hi Steve,

Thank you for making the EA so fast, i will start testing whit it wright now.
I will post the results of the tests as soon as possible.

grtzz,
Nik
niekes
Posts: 6
Joined: Mon Aug 13, 2012 10:51 am

Re: Semi-auto trading aide

Post by niekes »

Hi Steve,

I just tested whit the EA and there seems to be some problem.
The EA try's to open a trade but it can't because of invalid stops. (error 130)

On the screenshot i included you can see that it recognizes the red Sl line in the expert log file.
But on top you can see that the EA says it has a 0 pip SL and 0 pip TP.
I tried playing whit the EA settings but that doesn't help.


Grtzz,
Nik.
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Semi-auto trading aide

Post by SteveHopwood »

Looks as though you are trying to set a stop order too close to the market. That generates invalid stop errors.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Semi-auto trading aide

Post by SteveHopwood »

Ignore the screen tp and sl display - I forgot to remove it and it will disappear with the next update.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
niekes
Posts: 6
Joined: Mon Aug 13, 2012 10:51 am

Re: Semi-auto trading aide

Post by niekes »

Hi Steve,

You where Wright :) My buy stop was closer to the market then the spread. I just wanted it to trigger fast to test it.

I have been playing whit it and every thing seems to work fine.
There is one sneaky way that the price can get past the buy/sell order without opening a position when using a small SL.

It is when you are having losing position and the price is between the buy stop line and the SL line
(using 5 pip SL)
If at this point volatility goes up and spread gets suddenly bigger then 5 pips then the SL will get triggered and at the same time the spread will be to big to send a pending buy order.
This way price can move past the buy order line without opening a position, i just witnessed it while testing.

This is of course not the EA's fault and there is nothing that we can do about it, i just wanted to let you and all the others know that your position in not always guaranteed when using a small SL.

Thank you again for all your hard work, you are really a big help for all us mere mortals who can't code our idea's.

Grtzz,
Nik.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Semi-auto trading aide

Post by SteveHopwood »

You are most welcome.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
niekes
Posts: 6
Joined: Mon Aug 13, 2012 10:51 am

Re: Semi-auto trading aide

Post by niekes »

Hi steve,

I have been testing whit the EA for some days on different accounts and computers.

I have found that sometimes the Lines disappear, I don't know if its the EA deleting them or if there is something else going on.


Things i have already tried:

Putting the take profit line 1000 pips away.
Renaming the TP line in the script so that the EA doesn't recognize it.

It seems that the last generated order is when there was more volatility and price moved to the SL side. I am now testing whit the maximum spread on 24pips instead of 12 pips to see if there is some difference.

Can you think of other things that i can try?

Grtzz,
Nik.
niekes
Posts: 6
Joined: Mon Aug 13, 2012 10:51 am

Re: Semi-auto trading aide

Post by niekes »

I think i solved the problem, in the code there is a line that says something like : if profit > then 0 then delete pending line.......

I changed the 0 for 90000 because i know that is something that will never happen :)
I did this two days ago and since then the EA didn't deleted the lines anymore.

There was one occasion that the EA stopped trading while the lines where still there, the pending order line in still yellow so i guess the EA didn't changed it briefly to a green line to put the order in.

There where also no errors coming from the EA.

Grtzz,
Nik.
TheLocustFund
Trader
Posts: 15
Joined: Tue Apr 10, 2012 3:19 pm

Re: Semi-auto trading aide

Post by TheLocustFund »

http://www.trading4live.com/our-services.html

You read that right, they want $15,000USD for a semi-automated system with nearly the same inputs that this system has.

Just wow....
IF "Con" is the Opposite of "Pro", then what is the opposite of PROGRESS?
Post Reply

Return to “Automated trading systems”