Hello
im trying to make a stop loss/ trailing stop system for an EA that could be used on any currency pair, the problem is that a pip on one pair is worth more than on another pair
(ie USDJPY pip is more than a AUDUSD). How do you get around this?
thanks
You can use: MarketInfo(Symbol(),MODE_POINT);
Keith
You can use: MarketInfo(Symbol(),MODE_POINT);
Keith
No no no, you're confusing him, point is quite a reverse of digits. So if you have digits on a pair, point returns 0.00001, if you have 4 it returns 0.0001 and so.
What fatcheese wants, is this:
double RealTickValue(string contract) { double res; res= MarketInfo(contract,MODE_TICKVALUE) / (MarketInfo(contract,MODE_TICKSIZE)/MarketInfo(contract,MODE_POINT)); return(res); }The function will return how many dollars is a pip of a standard lot worth.
Hello
im trying to make a stop loss/ trailing stop system for an EA that could be used on any currency pair, the problem is that a pip on one pair is worth more than on another pair
(ie USDJPY pip is more than a AUDUSD). How do you get around this?
thanks
I do exactly this. My EAs are symbol-agnostic.
The way I do it is to make use of 2 variables which, like Ask & Bid are delivered as part of the framework and relate to the symbol of the chart to which the EA is attached.
These are:
-Digits --- I use this when preparing price related doubles for printing or emailing eg. Print("CurrentPrice ",DoubleToStr(dCurrentPrice,Digits));
-Point ----- I use this to perform calculations on price related doubles eg. dMyAbsoluteStopLoss = Ask-iMyRelativeStopLoss*Point;
You must also use Symbol() rather than a symbol name such as "EURUSD" when performing any trade operations.
Together, these techniques will allow you to construct a symbol-agnostic EA.
CB
im trying to make a stop loss/ trailing stop system for an EA that could be used on any currency pair, the problem is that a pip on one pair is worth more than on another pair
(ie USDJPY pip is more than a AUDUSD). How do you get around this?
Why are you worried about what a pip is worth? The whole point (forgive the pun) of Point is that you set a trailing stop to X pips using sl=X*Point; It doesn't matter what the monetary value of a point is the trailing stop is in points. If you start trying to convert each pip to $ or £ you will go bonkers. I have been told that a good trader doesn't care about the money they just look at the pips but I wouldn't know because I'm no good.
Why are you worried about what a pip is worth?
I don't believe he is concerned about the value of the pip. Its just how he chooses to describe the issue he faces in trying to design an EA which can be reused across all symbols.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello
im trying to make a stop loss/ trailing stop system for an EA that could be used on any currency pair, the problem is that a pip on one pair is worth more than on another pair
(ie USDJPY pip is more than a AUDUSD). How do you get around this?
thanks