Download MetaTrader 5
To add comments, please log in or register
Write your articles using our editor. It is convenient!
eenewbie
8
eenewbie 2014.03.02 23:34 

Hi

Background: I developed a custom indicator to calculate the lot size to trade based on my entry price and stop loss price. This indicator worked fine before the major upgrade to the MQL4 language.

Current situation: I can attach the indicator to my chart and it works. When I close MT4 and restart, the indicator unattaches itself from the chart automatically. Previously, it would be attached to the the chart until I remove it or close the chart.

Can someone help me, please? I have attached the indicator.

Files:
ekl_lots.mq4 3 kb
JPS1
239
JPS1 2014.03.03 01:29  
I don't know the solution to this, only commenting to confirm that you are correct, although it is random. I had to close and restart a few times before it happened and a second time was able to repeat it by just switching time frames, but not every time.
Alain Verleyen
Moderator
28672
Alain Verleyen 2014.03.03 10:06  
eenewbie:

Hi

Background: I developed a custom indicator to calculate the lot size to trade based on my entry price and stop loss price. This indicator worked fine before the major upgrade to the MQL4 language.

Current situation: I can attach the indicator to my chart and it works. When I close MT4 and restart, the indicator unattaches itself from the chart automatically. Previously, it would be attached to the the chart until I remove it or close the chart.

Can someone help me, please? I have attached the indicator.

Do you have any line printed in the logs relative to your indicator ? (See Experts and Journal tabs).

I got an error "divide by zero" when trying your code, on this line :

   Lots = AccountBalance() * risk / (SLpips * PipValue * 10);
/
To add comments, please log in or register