Newbie need help to code my strategy to autotrade

 

hi to all

i am new to this forum , can any one here, code my strategy to automate my trades in eur/usd .

the rules are simple.

Buy

(1)when price is above 50 ema by 20 pips,

stoploss 50 pips ,profit target 100 pips

(2) previous price cross should be a whipsaw

(3) i should get alert when my position is unfavourable by 25 pips, and my position is favourable by 50 pips

sell

(1)when price is below 50 ema by 20 pips,

stoploss 50 pips ,profit target 100 pips

(2) previous price cross should be a whipsaw

(3) i should get alert when my position is unfavourable by 25 pips, and my position is favourable by 50 pips

any help in this regard is highly appreciated

bye

 

it's hard/impossible to define the whipsaw for an EA

Hi shwetha

What you are asking for, is kind of difficult. I'm talking about the (2) condition. The first condition is simple but the problem is defining a whipsaw.

How do you set your conditions for the whipsaw? (Open & Close of the bar EMA50? Highest of the last X bars < EMA50+20pips & last Close<EMA50?...) These are simple examples but You have to give precise instructions.

I hope you understand my point. If you have any ideea on how to define the whipsaw please post it here.

 
cucurucu:
Hi shwetha

What you are asking for, is kind of difficult. I'm talking about the (2) condition. The first condition is simple but the problem is defining a whipsaw.

How do you set your conditions for the whipsaw? (Open & Close of the bar EMA50? Highest of the last X bars < EMA50+20pips & last Close<EMA50?...) These are simple examples but You have to give precise instructions.

I hope you understand my point. If you have any ideea on how to define the whipsaw please post it here.

technically a buy or sell signal is generated but it fails to give a pre defined profit target level is known as whipsaw .by putting second condition in my stategy i want take trade after one such whipsaw .in my eg a signal which has not generated 100 pips profit

i hope i clarified u'r doubt

thanks for u'r reply

 

Hi Shwetha

This is more precise. I will think about it.

(I kow what a whipsaw is, the problem was how to put it on code.)

Bye.

 

hello cucurucu

cucurucu:
This is more precise. I will think about it.

(I kow what a whipsaw is, the problem was how to put it on code.)

Bye.

ok meanwhile can you code for buy /sell condition one and for to generate alerts .regarding whipsaw i will monitor manually

iam eagerly looking to code my stategy and to trade automatically

thanks in advance

bye

 

This is your EA...

...but you have to think of some filters. This condition only, has no chances of success.

I have coded only the buy/sell section (condition 1). You can set it on "Ask manual confirmation" so you can decide if the EA should enter the trade.

If you find any bugs in this EA, please let me know.

Bye.

Files:
shwetha.mq4  5 kb
 

not able to open

hi

i downloaded the file ,but when i tried to open it it says access to the specified path /file or device is denied

what should i do

are u online now

any how thx a lot cucurucu

awiting for u'r reply

bye

 

1.You have to copy the file to your ProgramFiles\Metatrader\Experts folder.

2. You have to open the file using MetaEditor.

3. Click Compile button in MetaEditor.

4. Run MT4 and attach the EA to a chart.

Please note that the timeframe is set to 0. This means that the EA will use the timeframe of the chart.

I hope this solves your problems.

PS - This EA is working with MT4. I hope you don't use MT3.

 

hello cucurucu

hi i copied the file to program files\interbankfx\experts

it is copied i can see the code in meta editor ,but i could not see copile icon there but under file verify button is there ,when i clicked it

it verified the code and says 262 errors and 0 warnings

iam using mt 4 only

how to go about further

bye

 

:) you are not using MQL4

You are not using the right version of MetaEditor. MQL4 doesn't have "verify" button. Verify button is only in MetaEditor 3.x Please go to Help - About and see for yourself.

I doubt you are using MetaTrader4 since the MetaEditor version you're using is 3.x.

Good Luck!

 

hi

i found the file under experts and now successfully attached the same to my chart

now let me see how it trades

thx a lot

Reason: