You have just to multiply the StopLoss, TakeProfit, TrailingStop and BreakEven by 10.
You have just to multiply the StopLoss, TakeProfit, TrailingStop and BreakEven by 10.
Trading forex risk disclaimer. Exclusive EAs in the Elite section.
The point of a 3/5-digit broker is that it gives them the opportunity to offer tighter spreads (eg 2..5 pips instead of 3 pips).
There is another thread on the go which gives ideas on how to automatically adjust TPs and SLs inside an EA so that they will work on 3/5-digit brokers without having to multiply any of the variables by 10.
The logic is simple. You halve the digits and take the MathFloor of the result.
So for a 5-digit broker, this will return 2. You then multiply this result by 2 and if the answer is less than the digits you multiply TPs, SLs, etc by a factor of 10 before processing them further in OrderSend() functions.
You will need to declare the variables first. They will probably be different to mine anyway.
Then .........
Code://Code to adjust stop-losses for odd Alpari Point NewPipsBeforeSLatBreakeven=PipsBeforeSLatBreakeven; NewPipsToTrail=PipsToTrail; NewAddLevelPoints=AddLevelPoints; int HalfDigits,DoubleDigits; HalfDigits=MathFloor(MarketInfo(Symbol(),MODE_DIGITS)/2); DoubleDigits=HalfDigits*2; if(DoubleDigits!=MarketInfo(Symbol(),MODE_DIGITS)) {NewPipsBeforeSLatBreakeven=PipsBeforeSLatBreakeven*10; NewPipsToTrail=PipsToTrail*10; NewAddLevelPoints=AddLevelPoints*10;} //End of code to adjust stop-losses
[QUOTE=jezzer1961;7938]You will need to declare the variables first. They will probably be different to mine anyway.
Then .........
yes, thanks
it's clear.
but, i asked about value of indicators and distance between lines.
if(Rsi(1)-Rsi(0))>distance4dig* Point ....
it will be the same on 5 digit broker?
if Point on 4-broker = 0.0001 and for 5digit it.s = 0.00001 ,
so if i want the same value it's mean that must for 5 digit broker
dictance5dig=10*distance4dig
am i wright ?
Sorry, I haven't got a clue what you're trying to do there.
thanks jezz
sorry that my english is so hard to undestand
of course I don't want multiply value of indicators.
Look , in some ea is that condition :
...
extern bool UseDistance=false;
extern double Distance=7;
...
if(UseDistance&&(HMAA-HMAB)>=Distance*Point)HMABuy="true";
...
question was :
if Distance on 4brokers is 7 , it should be 7 on 5brokers or 70 ?
if we know that Point = ...?