EACreator.com Forum

EA Creator - Automate your forex strategies without programming www.EACreator.com


You are not connected. Please login or register

EA CLOSE ISSUES

View previous topic View next topic Go down  Message [Page 1 of 1]

1 EA CLOSE ISSUES on Thu Oct 11, 2012 7:46 pm

I have been trying to create a simple EA for a week without complete success. I need it to OPEN and CLOSE. It will open, but not close. This is what I am attempting, if only to confirm functionality.
This is an exponential MA on the close.
If you want to see what I am trying to create on the charts as a trading EA, make a 5 EMA and a 12 EMA and see the lengths of the profitable trades. 1 HR chart. Any pair.
Simple OPEN BUY and CLOSE BUY, OPEN SELL and CLOSE SELL.
5 EMA crosses over 12 EMA up for the OPEN BUY. 5 EMA crosses under 12 EMA down for the OPEN SELL.
To test functionality I want this IMMEDIATE.
Later I want to put in a minimum pip count to negate small movements.
5 EMA crosses under 12 down for the CLOSE BUY. 5 EMA crosses over 12 EMA up for the CLOSE SELL.
This I want to happen IMMEDIATELY. - not a candle later, or a minute later.

Any ideas??

View user profile

2 Re: EA CLOSE ISSUES on Thu Oct 11, 2012 7:49 pm

old_forum_question wrote:I have been trying to create a simple EA for a week without complete success. I need it to OPEN and CLOSE. It will open, but not close. This is what I am attempting, if only to confirm functionality.
This is an exponential MA on the close.
If you want to see what I am trying to create on the charts as a trading EA, make a 5 EMA and a 12 EMA and see the lengths of the profitable trades. 1 HR chart. Any pair.
Simple OPEN BUY and CLOSE BUY, OPEN SELL and CLOSE SELL.
5 EMA crosses over 12 EMA up for the OPEN BUY. 5 EMA crosses under 12 EMA down for the OPEN SELL.
To test functionality I want this IMMEDIATE.
Later I want to put in a minimum pip count to negate small movements.
5 EMA crosses under 12 down for the CLOSE BUY. 5 EMA crosses over 12 EMA up for the CLOSE SELL.
This I want to happen IMMEDIATELY. - not a candle later, or a minute later.

Any ideas??

Your signals should look like this:
open buy: 5 EMA > 12 EMA
open sell: 5 EMA < 12 EMA
close buy: 5 EMA < 12 EMA
close sell: 5 EMA > 12 EMA

Choose these signals as "Instant", which means that signals are active only at the moment when lines cross and not the whole time when comparison is true. If you need it to happen immediately, then set shift = 0 and ma_shift=0. This way you will get signal as soon as indicator lines cross. Probably you have set shift = 1 (which is by default), so it triggers signals only after the bar is finished.

Can you explain further what do you mean here: "Later I want to put in a minimum pip count to negate small movements"?

View user profile

3 Re: EA CLOSE ISSUES on Thu Oct 11, 2012 7:51 pm

Thank you for the help. You are right. I had my close logic incorrect and it was not closing. Also I had tried different shifts, including 0, but with the logic wrong it did not matter. I have corrected it all and it works fine now. Thanks.

The other statement I wrote was that once I got this thing to work I would try to insert a logic that would ignore small movements such as those found in consolidations and wait for the larger movements. I would delay entry until a certain pip value is reached to have a reasonable assurance it won't take useless trades. I'm on the 1 hour charts.

View user profile

4 Re: EA CLOSE ISSUES on Thu Oct 11, 2012 8:05 pm

old_forum_question wrote:Thank you for the help. You are right. I had my close logic incorrect and it was not closing. Also I had tried different shifts, including 0, but with the logic wrong it did not matter. I have corrected it all and it works fine now. Thanks.

The other statement I wrote was that once I got this thing to work I would try to insert a logic that would ignore small movements such as those found in consolidations and wait for the larger movements. I would delay entry until a certain pip value is reached to have a reasonable assurance it won't take useless trades. I'm on the 1 hour charts.

Do you mean pip value reached in Moving Averages cross or pip value in price movement during some time period?

If you need to add some pip value to MA, that faster MA would be by defined number of pips above the crossing point, you can use "Additional Operation" while creating signal. Let's say you want to add 5 pips:
5 MA > 12 MA +0.0005

Fill "+0.0005" into additional operation field.

If you need to measure price movement during some time period, you can create "candle pattern" signal and use it in combination with other opening signals. You can set minimum and maximum candle length for any timeframe.

View user profile

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum