Disliked{quote} Hi cja I am enclosing the code for an EA that I would like a couple of changes if possible and time permitting. I could pay a small fee that's reasonable for the effort. 1. need a Magic number 2 I need the code removed for Close on color change The stop loss and TP shoutstill be available in the inputs 3. I need an input variable for Max Orders. Please advise if that's possible and if you need anything else Thank you Malcolm {file}Ignored
about this function on your EA
maybe you're interested in this. Use TickSize too along with TickValue
and here is the link
i'm using define. To calculate lot based on risk, use PointValue if your SL_Range is Points. If it in Pips, use PipValue
TickValue/(TickSize/Point) == (TickValue*Point) / TickSize
(TickValue*Pip)/TickSize == TickValue/(TickSize/Pip)
your function will be :
Inserted Code
void CalculateValues() { string symb = Symbol(); double MinLot = MarketInfo(symb,MODE_MINLOT); CurrentATR=iATR(Symbol(),ATRtimeframe,ATRPeriods,1)*ATRMultiplier; if (UseATRSL) ActualSL=CurrentATR; else ActualSL=StopLossPips*Point*digitmultiplier; double RiskInMoney = AccountBalance()*(TradeRisk/100); double slRangeInPoints = ActualSL/Point; double PointValue = MarketInfo(Symbol(),MODE_TICKVALUE)/(MarketInfo(Symbol(),MODE_TICKSIZE)/_Point); UnitSizing = RiskInMoney / (slRangeInPoints*PointValue); if (LotSize>0) UnitSizing=LotSize; if (UnitSizing < MinLot) UnitSizing = MinLot; UnitSizing=NormalizeDouble(UnitSizing,2); }