View Single Post
  #1132 (permalink)  
Old 05-23-2008, 03:56 PM
Enforcer Enforcer is offline
Senior Member
 
Join Date: Dec 2007
Posts: 264
Enforcer is on a distinguished road
Quote:
Originally Posted by Lemyx View Post
Enforcer,

I've noticed that the variabe ProfitTarget has type "int".
(In the following text i mean that ProfitTarget=1).

So, when use MM is true and we are appropriating to ProfitSkew some fractional value < 0 (for example 0.6), then ProfitTarget will be = 0 due to type convertion. At least with small deposit. We can get profit > 0 only when trailing works.

If ProfitSkew equal, for example, 1.5, then in most cases we will get ProfitTarget=1.

I suggest to change type of ProfitTarget to "double".

Thanks.

EDIT:
Here is the changed code
Code:
...
extern double  ProfitTarget            = 1;  // All orders closed when this profit target amount (in dollars) is reached
...
 if(MoneyMangement){
  ProfitTarget=(AutoLot()*100.0*ProfitSkew);
 }
...
Will be changed on next version, for now change it yourself, is an easy fix for anyone.
Reply With Quote