/* Generated by EX4-TO-MQ4 decompiler V4.0.224.1 [] Website: http://purebeam.biz E-mail : purebeam@gmail.com */ #property copyright "Copyright © 2009, Joseph Seelentag" #property link "www.4xRobots.com" #property indicator_chart_window extern string H.1 = " ------------ Input your desired % risk --------------- "; extern double Desired.Risk.Percent = 2.0; extern string H.2 = " ------------------ Input either: --------------------- "; extern double Stop.Loss.In.Pips = 0.0; extern string H.3 = " ------------------------ Or: ------------------------- "; extern double Trade.Open.Price = 0.0; extern double Trade.Stop.Loss.Price = 0.0; double gd_132 = 1.0; int init() { if (Digits == 5 || Digits == 3) gd_132 = 10; return (0); } int deinit() { Comment(""); return (0); } int start() { double ld_0; int li_8; double ld_12; string ls_20 = ""; if (Desired.Risk.Percent <= 0.0) { ls_20 = "Wrong indicator parameters! " + "\n" + "You must input your desired risk percent." + "\n" + "Example: if you would like to risk 3% of the account, input: 3.0" + "\n" + "From the Charts menu choose Indicator List to change the Lots Wizard settings." + "\n"; Comment(ls_20); return (-1); } if (Stop.Loss.In.Pips > 0.0 && Trade.Open.Price > 0.0 || Trade.Stop.Loss.Price > 0.0) { ls_20 = "Wrong indicator parameters! " + "\n" + "You must input either: Stop.Loss.In.Pips or Trade.Open.Price" + "\n" + "You can\'\'t input both." + "\n" + "From the Charts menu choose Indicator List to change the Lots Wizard settings." + "\n"; Comment(ls_20); return (-1); } if (Stop.Loss.In.Pips <= 0.0 && (Trade.Open.Price > 0.0 && Trade.Stop.Loss.Price <= 0.0) || (Trade.Open.Price <= 0.0 && Trade.Stop.Loss.Price > 0.0)) { ls_20 = "Wrong indicator parameters! " + "\n" + "You must input both Trade.Open.Price AND Trade.Stop.Loss.Price" + "\n" + "You can\'\'t leave one of them zero." + "\n" + "From the Charts menu choose Indicator List to change the Lots Wizard settings." + "\n"; Comment(ls_20); return (-1); } if (Stop.Loss.In.Pips <= 0.0 && Trade.Open.Price <= 0.0 || Trade.Stop.Loss.Price <= 0.0) { ls_20 = "Wrong indicator parameters! " + "\n" + "You must input either:" + "\n" + "Stop.Loss.In.Pips" + "\n" + "or:" + "\n" + "Trade.Open.Price and Trade.Stop.Loss.Price" + "\n" + "\n" + "From the Charts menu choose Indicator List to change the Lots Wizard settings." + "\n"; Comment(ls_20); return (-1); } double l_maxlot_28 = MarketInfo(Symbol(), MODE_MAXLOT); double l_minlot_36 = MarketInfo(Symbol(), MODE_MINLOT); double l_lotstep_44 = MarketInfo(Symbol(), MODE_LOTSTEP); double ld_52 = AccountEquity() * (Desired.Risk.Percent / 100.0); double l_tickvalue_60 = MarketInfo(Symbol(), MODE_TICKVALUE); string ls_68 = AccountCurrency(); if (Stop.Loss.In.Pips > 0.0) ld_0 = Stop.Loss.In.Pips; else ld_0 = MathAbs(Trade.Open.Price - Trade.Stop.Loss.Price) / Point / gd_132; if (l_tickvalue_60 < 2.0) ld_12 = 10.0 * l_tickvalue_60; else ld_12 = l_tickvalue_60; double ld_76 = ld_52 / (ld_0 * ld_12); double ld_84 = 0; switch (l_lotstep_44) { case 0.01: li_8 = 2; break; case 0.1: li_8 = 1; break; case 1.0: li_8 = 0; break; default: li_8 = 1; } ld_84 = NormalizeDouble(ld_76, li_8); if (ld_84 > l_maxlot_28) ld_84 = l_maxlot_28; if (ld_84 < l_minlot_36) ld_84 = l_minlot_36; ls_20 = ls_20 + "" + "\n The Lots Wizard Indicator" + "\n" + "\n Courtesy of www.4xRobots.com" + "\n__________________________________" + "\n " + "\n Working on currency pair: " + Symbol() + "\n__________________________________" + "\n " + "\n Account information:" + "\n Account Balance = " + DoubleToStr(AccountBalance(), 2) + " " + ls_68 + "\n Account Equity = " + DoubleToStr(AccountEquity(), 2) + " " + ls_68 + "\n Account Free Margin = " + DoubleToStr(AccountFreeMargin(), 2) + " " + ls_68 + "\n Pair Tick Value = " + DoubleToStr(l_tickvalue_60, 2) + " " + ls_68 + "\n__________________________________" + "\n " + "\n "; if (Stop.Loss.In.Pips > 0.0) ls_20 = ls_20 + "Stop Loss in pips = " + DoubleToStr(Stop.Loss.In.Pips, 2); else { ls_20 = ls_20 + "\nTrade open price = " + DoubleToStr(Trade.Open.Price, Digits) + "\nTrade Stop Loss price = " + DoubleToStr(Trade.Stop.Loss.Price, Digits) + "\nTotal pips = " + DoubleToStr(ld_0, 0); } ls_20 = ls_20 + "" + "\n__________________________________" + "\n " + "\n Result:" + "\n " + "\n Open " + DoubleToStr(ld_84, li_8) + " lots." + "\n__________________________________" + "\n\n"; Comment(ls_20); return (0); }