Archive

Posts Tagged ‘slope’

Trend And Cycle

September 30th, 2011 Comments off

The indicators are proprietary, all histogram style. Two of the indicators signals come from change of slope and the third is both change of slope and zero line crossing.

Entry and exit logic, as stated in my brief summary, are dependent on which confluence of the indicators is being used:

IN1 = 1st indicator: FTLM_KG
IN2 = 2nd indicator: STLM
IN3 = 3rd indicator: JRSX

“Option 1″: IN1, IN2, and IN3

Enter only when IN1 and IN2 indicator are sloping in the same direction and IN3 is over/under zero line in same direction.

Exit partially when 1st, IN3 slope changes to opposite direction of IN2. 2nd, when IN1 slope changes in opposite direction of IN2, and 3rd/final, when IN3 crosses over/under zero line in opposite direction of IN2

“Option 2″: IN1 and IN2

Enter only when IN1 and IN2 indicator are sloping in same direction.

Exit partially at either pre-determined fixed pip gains or when IN1 slope goes opposite direction of IN2 or a combination of both exit possibilities because of the observed nature of this particular option.

“Option 3″: IN2 and IN3

Enter only when slope of IN2 and zero line cross of IN3 agree.

Exit partially 1st, when slope of IN3 is opposite direction of IN2 BUT zero line cross direction of IN3 is still in agreement w/ slope of IN2. 2nd, when zero line cross of IN3 is opposite to slope of IN2.

“Option 4″: IN1 and IN3

Enter only when slope of IN1 and zero line cross + slope of IN3 agree.

Exit partially 1st, when slope of IN3 is opposite to slope of IN1 BUT zero line cross direction of IN3 is still in agreement w/ slope of IN1. 2nd, when slope of IN1 is opposite to zero line cross direction of IN3. 3rd, when zero line cross direction of IN3 is opposite to original direction of the move.

_____________________________________________________

Please note that in all these Options, there are situations when thing don’t “line up” perfectly and quality moves are missed because IN1 or IN3 (depending Option being used) are already a couple bars into the current move before IN2 follows suit. To counteract that, I propose an option to decide the number of late bars on which it is acceptable to enter a trade. Also, considering the possibility of reducing position size for said instances in the event the move has already run its course and is going to go against order.

In regards to the code, I require it be commented adequately to minimize the possibility of any confusion in the event I need to make changes and collaborate w/ another programmer to do so.

If I can think of any other subtle nuances, I’ll share them w/ you as well.

Categories: Programming Tags: , , , , , ,

Ema Slope

July 21st, 2009 Comments off

I need some help here to calculate exponential moving average’s slope on metatrader 4.
Well i guess it is a quite easy job for a good programmer may be taking a while only.

here is the code i need, this is the metastock version.

pds:=Input(“EMA periods”,2,2520,13);
x:=Input(“use Open=1 High=2 Low=3 Close=4 Volume=5 P=6″,1,6,4);

x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,If(x=6,P,C)))));
EMA:=Mov(x,pds,E);
EMAprev:=Ref(EMA,-1);

y:=Min(EMA,EMAprev)/Max(EMA,EMAprev);
EMAratio:=(If(EMA>EMAprev,2-y,y)-1)*100;
EMAper:=If(EMAratio<0,Atan(EMAratio,1)-360,
Atan(EMAratio,1))*10/9;
signal:=Mov(EMAper,pds,E);

EMAper

this is all, quite easy i think however i cannot handle it.

Looking forward to hear from a good programmer.

Bear