**DrBeardface:**

Hi Guys,

So I'm trying to write a piece of code to calculate a take profit in PIPs that will equal a set percentage of the Account Balance at the time of placing the trade. I have preivously calculated the number of Lots for the trade as a function of the Stop Loss and Percentage Risk, and so I tried to rearrange the equation to work out a take profit, but I can't get it to work. Was hoping that someone could look at the maths and tell me where I've gone wrong. Here is the code.

The lot size calculates perfectly, but the take profit gives me silly numbers. I suck at maths by the way...I can not help you with the formula, as i scuk at math also.

But just like you set you stop levels where they need to be, so should your take profit level(s). Calculating your take profit level based on your account balance is similar to calculating your take profit level based on the current outside temperature. There is no correlation.

Hi Guys,

So I'm trying to write a piece of code to calculate a take profit in PIPs that will equal a set percentage of the Account Balance at the time of placing the trade. I have preivously calculated the number of Lots for the trade as a function of the Stop Loss and Percentage Risk, and so I tried to rearrange the equation to work out a take profit, but I can't get it to work. Was hoping that someone could look at the maths and tell me where I've gone wrong. Here is the code.

The lot size calculates perfectly, but the take profit gives me silly numbers. I suck at maths by the way...