Fibonacci_Ema - page 9

To add comments, please log in or register
accrete
71
accrete  

Question on "Delta" and Buy-Sell coding

Hi again, I wonder if there was a small error in the code of v2? Here is what i find:

if (

(Buy1_1 = Buy2_3+Delta*Point) ||

(Buy2_1 > Buy2_3 /*&& Buy1_1 = Buy2_2+Delta*Point)

) Order = SIGNAL_BUY;

if (

(Sell1_1 > Sell1_3 && Sell2_1 <= Sell2_3+Delta*Point)//Accrete changed this to match line one in Buy above

// original line was: (Sell1_1 > Sell1_3 && Sell2_1 <= Sell2_3) ||

(Sell2_1 = Sell1_2*/ && Sell2_1 <= Sell2_2-Delta*Point)

) Order = SIGNAL_SELL;

So my paste above, i hope that i've done the correct thing by changing this code as shown here (again for detail's sake):

(Sell1_1 > Sell1_3 && Sell2_1 <= Sell2_3+Delta*Point)//changed this to match line one in Buy but on Sell

// original line was: (Sell1_1 > Sell1_3 && Sell2_1 <= Sell2_3)

Thank you in advance.

Now onto my "Delta" question.Am i correct in thinking, while looking at the code that the "Delta" will place the no-trade-zone around both the main and close moving averages? This is a good thing if that is what the code is telling us in my opinion. I just wanted to make sure i was reading things correctly as written.

--------one more Q.

double Sell1_1 = iMA(NULL, 0, SignalEMA_Period, 0, MODE_EMA, PRICE_CLOSE, Current + 1);

double Sell1_2 = iMA(NULL, 0, CloseEMA_Period, 0, MODE_EMA, PRICE_CLOSE, Current + 1);

double Sell1_3 = iMA(NULL, 0, MainEMA_Period, 0, MODE_EMA, PRICE_CLOSE, Current + 1);

If the "Buy" code has "Current + 1" should the above posted code for the "Sell" have "Current - 1" instead of +1??

Cheers,

Thom

Sergey Golubev
Moderator
114712
Sergey Golubev  
YupYup:
Yea, in the first post: Statement #2 modeling quality 84% and it only goes back to 2005, not trying to argue... because i appreciate your help newdigital!

B

Edit: Statement #1 modeling quality 90% and it too goes to 2005 here's the dates off statement 1 - 30 Minutes (M30) 2005.10.25 00:00 - 2005.12.25 00:00

YupYup,

You looked at the wrong EAs and wrong statements.

I've never updating anything on the first post of the thread.

May be it is not good but on the first posts of this thread you may see very old EA with very old satements. I am not updating anything on the first post (and asctrend thread as well - nothing was updated on the first post).

The most recent EAs and the satements are here and especially here. 4 pairs with modeling quality 90% back to 2001.

Please don't use EmaFibo_V2 and EmaFibotf_V2 for now because it was found the bug inside coding (thanks accrete).

Sergey Golubev
Moderator
114712
Sergey Golubev  
solaris:
ND, that is how I understand it from codersguru's ProfitProtect. However, that will take away some further pips gain from other pairs which may have more room to move in the direction of the trade.

My idea is more specific to the pair which is reversing. I realize that such pair maybe moving back to the trade direction. But this will be no different than having it hit my breakeven or trailing stop. Actually, I think a code that simply says that if the trade reach a certain # of pips that it protects x # of pips profit, i.e. 10 pips or 5 pips from the cross exit.

I hope that I got my idea across.

So, far the most pips loss I have had was -30 pips on one pair. The EA runs fully automatic, no interference at all.

BTW, another possible enhancement is using a percentage of the Average Daily Range built in within the EA codes as the profit target. The % could be user input.

Question, if I close a trade manually, will it re-enter a trade before another incidence of the trade entry or re-entry condition?

That's it for now. ND, your endless effort and unselfish contribution to this forum is very much appreciated.

solaris

P.S. FYI, I use different MA settings from the originals in the EA.

I got your idea but this EA is having two possibility fot exit:

- exit on crossing of SignalEMA and CloseEMA;

and (not or)

- exit on Stop Loss, take Profit and ts (if StopLossMode = True, TakeProfitMode = True, TrailingStopMode = True).

What does it mean?

It means that if you set TrailingStopMode = True so EA will close the orders accoding to crossing and Trailing Stop as well (Stop loss value will be moving).

Exit of crossing is always "True". But if you set "TrailingStopMode = True" for example so you will have additional possibility for exit.

And StopLossMode, TakeProfitMode and TrailingStopMode are working separatedly from each other. For example EA will use trailing stop anyway even if you have the following settings:

TrailingStopMode = True;

TakeProfitMode = False;

StopLossMode = False.

In this settings EA will use exit on crossing instead of stop loss and will use trailing stop as well.

Any other combination is valid as well.

Please note thatn I am talking about EAs posted here and here.

Sergey Golubev
Moderator
114712
Sergey Golubev  
accrete:
Hi again, I wonder if there was a small error in the code of v2? Here is what i find:

So my paste above, i hope that i've done the correct thing by changing this code as shown here (again for detail's sake):

(Sell1_1 > Sell1_3 && Sell2_1 <= Sell2_3+Delta*Point)//changed this to match line one in Buy but on Sell

// original line was: (Sell1_1 > Sell1_3 && Sell2_1 <= Sell2_3)

Thank you in advance.

Now onto my "Delta" question.Am i correct in thinking, while looking at the code that the "Delta" will place the no-trade-zone around both the main and close moving averages? This is a good thing if that is what the code is telling us in my opinion. I just wanted to make sure i was reading things correctly as written.

--------one more Q.

If the "Buy" code has "Current + 1" should the above posted code for the "Sell" have "Current - 1" instead of +1??

Cheers,

Thom

No, "current - 1" is fully wrong. It is the future bar.

Sorry.

As to Delta so look at the code:

if (Buy1_1 < Buy1_3+(Delta*Point) && Buy2_1 >= Buy2_3+(Delta*Point)) Order = SIGNAL_BUY; if (Sell1_1 > Sell1_3-(Delta*Point) && Sell2_1 <= Sell2_3-(Delta*Point)) Order = SIGNAL_SELL;

Look at the image attached illustrating this Delta:

only MainEMA is having Delta.

Files:
Sergey Golubev
Moderator
114712
Sergey Golubev  

And look at this image (attached) from USDJPY pre-set files why we need this Delta.

In USDJPY pre-set Delta=1 so sometimes it helps, sometimes not (1 means almost nothing).

YupYup
198
YupYup  

Thanks for clarification

ND,

Thanks for showing me what posts you meant . I was wondering which ones you were talking about, but now i know!

B

Sergey Golubev
Moderator
114712
Sergey Golubev  

It was EmaFibo_v1 EA.

As I understand accrete was talking about EmaFibo_v2 EA:

if (

(Buy1_1 = Buy2_3+Delta*Point)

||

(Buy2_1 > Buy2_3 && Buy2_1 >= Buy2_2+Delta*Point)

) Order = SIGNAL_BUY;

if (

(Sell1_1 > Sell1_3 && Sell2_1 <= Sell2_3)

||

(Sell2_1 < Sell2_3 && Sell2_1 <= Sell2_2-Delta*Point)

) Order = SIGNAL_SELL;

It means that in v #2 we have the same Delta applied on the MainEMA (first entry condition) and on the CloseEMA ( second entry condition).

Look at the image attached. I am not really sure that we need this Delta on the second (re-entry) condition.

Files:
emafibo2.gif 27 kb
Sergey Golubev
Moderator
114712
Sergey Golubev  
newdigital:
It was EmaFibo_v1 EA.

As I understand accrete was talking about EmaFibo_v2 EA:

if (

(Buy1_1 < Buy1_3 && Buy2_1 >= Buy2_3+Delta*Point)

||

(Buy2_1 > Buy2_3 && Buy2_1 >= Buy2_2+Delta*Point)

) Order = SIGNAL_BUY;

if (

(Sell1_1 > Sell1_3 && Sell2_1 <= Sell2_3)

||

(Sell2_1 < Sell2_3 && Sell2_1 <= Sell2_2-Delta*Point)

) Order = SIGNAL_SELL;

It means that in v #2 we have the same Delta applied on the MainEMA (first entry condition) and on the CloseEMA ( second entry condition).

Look at the image attached. I am not really sure that we need this Delta on the second (re-entry) condition.

I corrected the code for EmaFibo_v2 EA. Now we have 2 Delta(s).

As I am not really sure that we need at least one of it so I set the value of Delta1 and Delta2 to 0.

Anyway everybody please feel free to change anything inside the code. because I may do some mistake sometimes.

Files:
Sergey Golubev
Moderator
114712
Sergey Golubev  

I looked at the pre-set files for EmaFibo_v1 EA and compare it to manual trading and found very strange thing: sometimes w have one order already opened but SignalEMA is not crossing CloseEMA yet but crossing MainEMA once again. So do we need to have the possibility to open more than 1 order at the time (MaxOrders = 3;for example)?

accrete
71
accrete  

Hi all, Thank you for the clarification ND, much appreciated. I went ahead and inserted the multiple Delta code into the "Time Filter" version with default settings and then the same EA but defaults set to the MA settings that i'm using on a five minute chart if anyone is interested in seeing what i've mentioned as "Four Demensional Charts" taking multiple time frames into account. Both EAs are found at this link. The one with my settings has the "atm" as part of the file name.

Cheers,

Thom

=====this next bit is a post script... And a question on the secondary entry signal

On the GbpUsd trade for today v2tf (tf currently false) the EA closed out in profit after a retracement and the trailing stop closed the sell. This was nice (about 70 pips), but then shortly after that i noticed a sell arrow that did not make sense to me. The signal MA was well below the "close" ma, which was also well below the "main" MA. I thought the only time the EA would enter a new secondary entry position was after the signal went (in this case of a sell market) above the "close" MA, then went below the "close" MA continuing in the trend?

To add comments, please log in or register