Reply

How setting Profit Target at 2x of StopLoss

4 replies

Rolli

Subscriber, bbp_participant, community, 1 replies.

Visit profile

11 years ago #110894

Hi,

I have the problem to set the "then" part of the rule.

When using "Profit Target Dialog" Window and "Custom Price Level" one can chose "Multiplication".
I want have Profit Target at a long-trade 2x StopLoss above Entry.
So I took —> [b]2 * Order SL (magic#)[/b] <— (see attached screenshot).

But that doesn't run in MT4. – Why?

—————–

—————–

furthermore in the "IF"-part I want use the "Indicator Angle" of "Functions".

I cannot get it. Anything I make wrong.

Angle of EMA(20) shall be more than 25 degrees in uptrend and lower than -25 degrees in downtrend.
How to key in the 25 degrees?

Can anybody help?

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

11 years ago #120885

Hello,

the problem is that in your Profit Target you are calling Order SL () function for order that wasn’t yet opened, it will not work.
But the solution is relatively simple, your entry price is at High[1], your Stop Loss is at Low[1], so the Stop Loss size is in fact (High[1]- Low[1]).

Then Profit Target size would be 2 * (High[1]- Low[1])

File: sl.pngsl.png

furthermore in the “IF”-part I want use the “Indicator Angle” of “Functions”.

I cannot get it. Anything I make wrong.
Angle of EMA(20) shall be more than 25 degrees in uptrend and lower than -25 degrees in downtrend.
How to key in the 25 degrees?

indicator angle depends on your timeframe, zooming of the chart and also on indicator you use.
Specifying angle is simple – see screenshot, but you also have to specify the right coefficient.

File: angle.pngangle.png

I do it in a way that I create a simple signal indicator in EA Wizard with Indicator Angle and I create a parameter for the Angle Coefficient.
Then I apply the indicator to the chart and I see where the indicator is bigger than given value.

I can also change the coefficient to improve the results.

Then if you’ll use the same coefficient in your EA you’ll get the same results.

Mark
StrategyQuant architect

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

11 years ago #121041

How do we use this? I opened your SQW file and then put it on a chart (I export as an Angle Indicator, correct?)

So the histogram, show the angle at whcih the EMA is at at that moment. And when it is less than 0 degrees (goign down), it is on the bottom side of zero on the histogram.

I was looking for an angle of the ADX Main line, because it seems that if the ADX is rising at a high angle is different than just above the 25 threshold line most peopel talk about. So I wanted to see how to use the angle in an EA, but did not find anything.

Then I found this post. So I modified your indicator to be for ADX (attached). and what it looks like in the MT4 is the second screenshot. So few questions about the ADX:

1. what does this indicator tell me?
2. I change the coeficient and it does not change anyting on the indicator
3. In both the EMA and ADX Angle indicators, what does the coeficient do and how do I know what number should that be? In your post you said you mess around with it. What tells you that you found the good number.
4. In your SQW file, you had the angle is > 25. What is 25? I put that number as an input in the attached file, and it does not change either EMA or ADX angle indicator at all.

I appreciate feedback, because when I searched internet, there was nothing much that can tell me out there that I could find.

Thanks,
Stearno

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

11 years ago #121047

Hello,

you probably made a mistake, but you didn’t modify your indicator to be angle of ADX, you still used Moving Average.
I’m attaching ADX angle indicator here.

1. what does this indicator tell me?

this indicator tells you what is the angle of ADX

2. I change the coeficient and it does not change anyting on the indicator

you probably have to change it more. The coefficient could be anything from 0.00005 to 50, from my observation very small values are good for price-based indicators (like moving average) and values around or higher 1 are good for oscillators like CCI, RSI and ADX. For ADX it seems the best AngleCoef is around 1.

3. In both the EMA and ADX Angle indicators, what does the coeficient do and how do I know what number should that be? In your post you said you mess around with it. What tells you that you found the good number.

coefficient is simply a number that multiplies the computed angle to get some reasonable results. You should set it so that the angle reported by the indicaotr matches what you see on the screen.
For example, when you see that indicator line is rising at 45 degrees, you should set the coefficient so that the reported angle of the indicaotr is also 45 degrees.
Unfortunately, there’s no automatic way to determine the coefficient, it depends on the indicator values, your timeframe, your chart zoom etc.

4. In your SQW file, you had the angle is > 25. What is 25? I put that number as an input in the attached file, and it does not change either EMA or ADX angle indicator at all.

that’s there just to have a complete comparison, the number doesn’t matter, it is not used in the angle indicator.

Mark

Mark
StrategyQuant architect

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

11 years ago #121048

Great. Thank you. After testing, your indi coeficient for ADX is around 3.0, which gave similar readings to the Line Angle tool. Thanks for clearing this up for me!

-Stearno

0

Viewing 4 replies - 1 through 4 (of 4 total)