Help needed with Exper advisor - page 2

 

hi amit,

i feel like we are talking using different language.

could you do the following step:

1. run the EmaDI2 EA, don't forget to tick "Visual Mode"

2. after the EA finish, you'll get a chart with arrows that show the entry and exit. just like the one i've posted on the previous post

3. scroll the chart to the part that contain entry/exit that didn't match the rules.

4. post the chart

after that, we could discuss the EA result based on that chart and fix the problem together.

without the chart, i can't see the wrong logic in my EA accroding to the rules. this strategy is very simple, and so the coding.

 

Hi Sangmane,

I tested the EMADI2 using the visual mode as you had instructed and there are some descripancies as shown in the attached jpg. However while testing the transaction where i have placed the red arrow, i noticed something strange. say on a particular date, even though -DI has crossed +DI as can be seen by the naked eye, however their values show that +DI is still higher as can be confirmed by their respective values. Thus in this particular transaction, the EA is selling on the date next to what i am selling because the DI values get updated after a full day and the EA is right in doing so. Is there any workaroung for this.

Also even if we trade manually, will the live account setup be the same as the demo account. Is there any broker where i can open a live account immediately and start trding instead of waiting a long time for the account to open.

Thanks

Amit

Files:
1.jpg  208 kb
 

EmaDI-2 - Revised StopLoss and TakeProfit

Hi Amit and Sangmane...

I'm a novice Fx coder and this is a nice little EA to play with and learn from for both the code and the strategy. Thanks.

I tested both the EmaDI and EmaDI-2 and I found that the StopLoss and TakeProfit did not seem to work. I added a formula with "Point" and used // to disable the original code so you could compare both codes.

Most trades look good, but some trades look out of place and on quick glance are hard to match with the strategy. But I did not spend too much time to see how the code is following the strategy at this point.

I also found that longer MA cycles produce more profits (3/50, 5/80, etc) and I reached a 2.75 Profit Factor....still had some major reversals/losses, but these are very tempting results and a nice start for this EA.

Below is what I added to make the StopLoss and TakeProfit to work and I hope it helps.

Good Luck,

Robert

EmaDI-2 EA

FOR BUY

if(MaFast>MaSlow && PlusDI>MinDI && PrevPlusDI<PrevMinDI)

{

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"My EA",16384,0,Green);

//ORIGINAL --- ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,StopLoss,TakeProfit,"My EA",16384,0,Green);

FOR SELL

if(MaFast<MaSlow && PlusDIPrevMinDI)

{

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"My EA",16384,0,Red);

//ORIGINAL --- ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,StopLoss,TakeProfit,"My EA",16384,0,Red);

 

EmaDI-2 - Strategy Tests

I did a few tests with the EA and it seems to be very accurate. Nice coding.

However....like any EA, it hits noisy periods or quick reversals that need more filtering.

SL and TP are strategies to deal with them, but maybe another filter or additional strategies, like X_pips to cross, or other confirmations are needed?

Overall nice job! Here are a few charts to review and consider.

Robert

 

hi cosmiclifeform,

thanks for your comment about the EA. yes you are right, i wrongly coded the SL and TP as i concentrate on the original rules that not using SL and TP. that's why i put TP=0 and SL=0 in the external variable

pls find the corrected code. please note that for 5 digit broker, 1 pips = 10 point so for example TP/SL = 50 pips, you should input 500 instaed of 50

for amit, i'm waiting for your attachment approved. hope we can clear the things up together...

cheers

Files:
emadi2.mq4  3 kb
 

Hi Sangmane and Cosmiclifeform,

Thanks for all ur help here.

Sangmane, i tested the latest EMADI2 but it says "Error processing buy/sell orders" when i try to use strategy tester.

I think the difference in what i am doing manually and the EA is doing automatically is that the EA is probably taking the closing value of that particular period in which the DI cross is happening. Is it possible to take the value for placing an order the exact moment the DI cross is taking place.

Forgive me if my fundas are not clear and the above mentioned is not making any sense. :-).

Amit

 

Hi,

Another couple of systems i tried and i think are worth a look.

System 1

VQ indicator

ADX14

Buy- When VQ gives a buy indication and +DI is above -DI.

Close buy- When +DI goes below -DI or VQ gives a sell signal.

Sell- When VQ gives a sell signal and -DI is above +DI.

Close Sell- When -DI goes below +DI or VQ gives a buy signal.

No SL or TP.

System 2

VQ indicator

EMA5

EMA80

Buy- When VQ gives a buy signal and EMA5 is above EMA80.

Close Buy- When VQ gives a sell signal or EMA5 goes below EMA80.

Sell- When VQ gives a sell signal and EMA5 is Below EMA80.

Close Sell- When VQ gives a buy signal or EMA5 goes above EMA80.

No SL or TP.

Here i would like to mention that VQ does not wait for the completion of the bar to give a signal and may give the signal in between of the chosen time frame and so the buy/sell should be executed at the instant VQ gives the signal. Also The Buy close/Sell close signal depending on the EMA or DI cross should be executed the instant the cross takes place and should not wait for the bar to close.

Thanks

Amit

Files:
vq.mq4  8 kb
Reason: