- is threre any EA trading on GOLD or SILVER ?
- Discussion
- AMD or Intel as well as the memory brand
angevoyageur - yes I did.
I 'm visting this Forum for quite some time now (many a year) and usually found my answers here. I also tried MoneyTec, ForexFactory, Forex-Td and of course apart from these - also good old Google. It could be that developers don't have this requirement, I don't know. And then - it could be that I'm growing too old to figure this out... :-)
But anyway - thanks for reading my first post.
I can also see in the Journal that the Number of Lots calculated is 10 times too high. And then of cause I get error 131.
@WHRoeder - thankyou for the suggestion. I'm still trying to work trough the EA that you supplied on the forum as well. I have great respect for your work.
@angevoyageur - I only saw (after I went to town) that you supplied a link. But yes - I did go through all those as well. Thanks - I appreciate...
You have to use this formula to calculate your lot size :
LotSize = RiskAmount/(sendStopLoss*Point) / (TickValue/TickSize);
int init() { . . if (Digits == 5 || Digits == 3){ pips2dbl = Point*10; pips2points = 10; Digits.pips = 1; } else { pips2dbl = Point; pips2points = 1; Digits.pips = 0;} <--------------------------Put these in the INIT function . . . if(sendDynamicLotSize == true && sendStopLoss > 0 && PercentageBased == true) { double RiskAmount = SomBalans * (sendEquityPercent / 100); double PipValuePerLot = DeltaValuePerLot() * pips2dbl; <---------------------------------------------------------Changed in CalcLots function if(sendStopLoss != 0 && PipValuePerLot != 0) double LotSize = (RiskAmount/sendStopLoss)/PipValuePerLot;} <---------Changed in CalcLots function . . . double DeltaValuePerLot() <------------- Function on its own { return(MarketInfo(Symbol(), MODE_TICKVALUE) / MarketInfo(Symbol(), MODE_TICKSIZE)); }3 the pieces of code above...
...
The previous post shows the formula that ar eidentical for both Brokers. pips2dbl stays the same although IBFX is a 2 Digits broker (on the chart that is).
This problem is way above my "coding" grade... :-)
I don't know what else to check...
@angevoyageur: Thanks for your patience.
I hardcoded 0.1 Lots in the CalcLots function - the only lotsize that can come out of that function - and still.... error 4051.
So it must be something odd that I'm not capable of seeing.
Bearing in mind the CalcFunction is doing it's job superbly on the other broker (Alpari). What's really funny (odd) is the pips2dbl variable which is the same for both the 3 and 2 digit brokers.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use