
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
That should help..
I of course have code for the EA which checks the signals too, but I doubt there is something wrong with that code since that worked good before I put the TrailingStop in.
Thanks for your help, RaptorUK.
You need to learn to count and check your { } braces . . . and have a consistent formatting style.
You are missing these . . .
before this line of code . . .
double GetDecimalPip()
You need to learn to count and check your { } braces . . . and have a consistent formatting style.
You are missing these . . .
before this line of code . . .
Thanks for that..
The code works now.. No compiling errors.
The only problem is that I can't get it to only trail when my trade almost has reached it's takeprofit.
The code right now trails right away and often gives me way lower profits because it's doesn't allow the trade to almost hit the take profit before it changes anything again.
Thanks for that..
The code works now.. No compiling errors.
The only problem is that I can't get it to only trail when my trade almost has reached it's takeprofit.
The code right now trails right away and often gives me way lower profits because it's doesn't allow the trade to almost hit the take profit before it changes anything again.
Hi YoungMoney,
The TrailStops functions trails the stoploss pip by pip if the stoplevel allows it, which is the "safer" way to trail the stop (Drawdowns are smaller).
What do you exactly want and why?
Hi YoungMoney,
The TrailStops functions trails the stoploss pip by pip if the stoplevel allows it, which is the "safer" way to trail the stop (Drawdowns are smaller).
What do you exactly want and why?
So If I understand it correctly if I set the "g_TrailingStop" to 30, Then:
-When the trade is 30 pips in profit the EA will move the stoploss to the bid/ask at the moment??
So If I understand it correctly if I set the "g_TrailingStop" to 30, Then:
-When the trade is 30 pips in profit the EA will move the stoploss to the bid/ask at the moment??
Mh... Here is what they mean:
So, if GreedyTrailing is enabled, the stoploss is trailed very aggresively. For instance:
If GreedyTrailing is disabled, the stoploss can only be trailed once the new value is above the opening price. For instance:
You should adjust the g_StopLoss and the GreedyTrailing parameter to meet your strategy. As a short recipe, you would normally...
If you want a more complex evaluation of the profits, you could use the OrderProfit() function to do something more custom, like halving your position, moving the stoploss to the opening price and so forth.
Flaab, thanks for your help.
This code seems to have some problems with stopping trades correctly. The trade is in profit and it still does not move the stop loss line to the chosen amount of pips away from BID/ASK.
Below I have 2 screenshots of a situation like that. If the code had done the correct thing, that trade would be in big profit.
I hope you understand the situation.
Here are my EA options:
StopLoss = 140
TakeProfit = Do not Use
TrailingStop = true
GreedTrailing = false
g-TrailingStop = 100