Jump to content

Trade Gold with MT4 - Gold Trade Pro


forexample

Recommended Posts

This looks like a good system for trading gold. I have been using Stealth Forex profitably and continue to do so. Can anyone share this product?

 

Further to this...if this system could be coded as an EA triggering buys/sells on the arrows we could backtest it for real...

 

http://www.goldtradepro.com/

 

http://www.goldtradepro.com/Chart.gif

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 2 weeks later...

Re: Trade Gold with MT4 - Gold Trade Pro

 

/*

Generated by EX4-TO-MQ4 decompiler V4.0.223.1c []

Website: http://purebeam.biz

E-mail : [email protected]

*/

#property copyright "Stuart Anderson"

#property link "[email protected]"

 

#include <WinUser32.mqh>

 

#import "backbone.dll"

void Start(string a0);

void liregister(string a0);

int livalidate(string a0, string a1, string a2, bool a3);

void upload(double a0, double a1);

bool direction(double a0);

int adj(int a0);

int ndj(int a0);

bool isworkable();

#import

 

extern string gp = "--== General Parameters ==--";

extern double LotSize = 0.1;

extern double LotSizeBasedOnMargin = 0.0;

extern int MartingaleMultiple = 0;

extern bool Enable_StealthMode = FALSE;

extern int Slippage = 50;

extern int Magic_No = 676789;

extern string lic_info1 = "--== Enter the Licence Code and Your Live A/c No. ==--";

extern string lic_info2 = "-- Leave The Account No. Blank If You Dont have it Yet --";

extern string License = "";

extern string Account_No = "";

extern string octs0 = "--== Open Close Trading System ==--";

extern string tol0 = "-- Trade Open Logic --";

extern string ots1 = "1-Open On Arrow Only";

extern string ots2 = "2-Open On Arrow & TCCI";

extern string ots3 = "3-Open On Arrow & TCCI & uTcci";

extern int tol = 1;

extern string tcl0 = "-- Trade Close Logics --";

extern string cts1 = "1-Close On Arrow Only";

extern string cts2 = "2-Close On TCCI Only";

extern string cts3 = "3-Close On Arrow & TCCI";

extern string cts4 = "4-Close On Arrow & TCCI & uTcci";

extern string cts5 = "5-Close On Arrow or TCCI";

extern string cts6 = "6-Close On Arrow or TCCI or uTcci";

extern string cts7 = "7-None";

extern int tcl = 1;

extern string tsol = "-- Trade System Other Logics --";

extern int SignalCandle_Size = 0;

extern bool alwaysReverse = FALSE;

extern int open_tcci_confirm = 2;

extern int open_arrow_confirm = 1;

extern int close_tcci_confirm = 2;

extern int close_arrow_confirm = 1;

extern string obmp = "--== Open & Close Trade on Bar Open ==--";

extern bool Enable_OpenTrade = FALSE;

extern bool Enable_CloseTrade = FALSE;

extern string ltb = "--== Minimum Length of Last TCCI Trend ==--";

extern bool Enable_MLTT = FALSE;

extern int MLTT_Length = 0;

extern string ltr = "--== Minimum Price Movement ==--";

extern bool Enable_MPM = FALSE;

extern int ltr_bars_to_check = 0;

extern int MPM_Pips = 0;

extern string lttpr = "--== Minimum TCCI Value Movement ==--";

extern bool Enable_TVM = FALSE;

extern int lttpr_bars_to_check = 0;

extern int TVM_Value = 0;

extern string eep = "--== Trade Limit ==--";

extern int Set_Limit = 0;

extern int Set_StopLoss = 0;

extern string tsp = "--== Trailing Stop Loss Parameters ==--";

extern bool TS_Enabled = FALSE;

extern int Set_TS = 0;

extern string tccip = "--== TCCI Parameters ==--";

extern int Price = 0;

extern int Length = 22;

extern int Displace = 0;

extern int Filter = 0;

extern int Color = 1;

extern int ColorBarBack = 1;

extern double Deviation = 0.0;

extern string utccip = "--== Upper TF TCCI Parameters ==--";

extern int uPrice = 0;

extern int uLength = 22;

extern int uDisplace = 0;

extern int uFilter = 0;

extern int uColor = 1;

extern int uColorBarBack = 1;

extern double uDeviation = 0.0;

extern string utfp = "M5=5 ; M15=15 ; M30=30 ; H1=60 ; H4=240 ; D1=1440 ; W1=10080 ; MN1=43200";

extern int UpperTF = 0;

extern string ttp = "--== Trading Times ==--";

extern int starthour = 0;

extern int startmin = 0;

extern int stophour = 0;

extern int stopmin = 0;

double gd_512 = 0.0;

double gd_520 = 0.0;

double gd_528 = 0.0;

int gi_536 = 0;

int gi_540 = 0;

int g_datetime_544;

int g_datetime_548 = 0;

string gs_unused_552 = "";

int gi_560 = 100;

 

int init() {

if (!IsDllsAllowed()) {

Alert("DLL Blocked. EA Closed.");

return (0);

}

if (!IsConnected()) {

Alert("No Connection. EA Close.");

return (0);

}

if (!IsLibrariesAllowed()) {

Alert("Library Blocked. EA Close.");

return (0);

}

/* License = StringTrimRight(StringTrimLeft(License));

Account_No = StringTrimRight(StringTrimLeft(Account_No));

Start(Account_No);

int li_0 = livalidate(License, Account_No, AccountNumber(), !IsDemo());

if (li_0 != 6) {

if (License != "" || Account_No != "")

if (MessageBox("Are You Sure Want to Register Account #" + Account_No + " with the license code.", "Register", MB_OKCANCEL) == IDCANCEL) return (0);

}

liregister(License);

li_0 = livalidate(License, Account_No, AccountNumber(), !IsDemo());

if (li_0 == 1) Alert("ERROR: INVALID KEY");

if (li_0 == 2) Alert("ERROR: INVALID PRODUCT");

if (li_0 == 3) Alert("ERROR: EXPIRED KEY");

if (li_0 == 4) Alert("ERROR: INVALID MACHINE");

if (li_0 == 5) Alert("ERROR: Different Live Account Than Registered");

if (li_0 == 6) Alert("SUCCESS");*/

g_datetime_544 = iTime(Symbol(), 0, 0);

return (0);

}

 

int deinit() {

return (0);

}

 

int start() {

upload(Bid, Ask);

if (!isworkable()) return (0);

gi_536 = open_arrow_confirm;

gi_540 = open_tcci_confirm;

if (newBarOpen() || !Enable_OpenTrade) {

if (LTR_check() && LTB_check() && LTTPR_check()) {

if ((iHigh(Symbol(), 0, gi_536) - iLow(Symbol(), 0, gi_536)) / Point < SignalCandle_Size || SignalCandle_Size <= 0) {

if ((getArrowStatus() == "up" && tol == 1) || (getArrowStatus() == "up" && getTCCIStatus(1) == "up" && tol == 2) || (getArrowStatus() == "up" && getTCCIStatus(1) == "up" &&

StringFind(getuTCCIStatus(UpperTF), "up", 0) >= 0 && tol == 3)) {

closeTrade(OP_SELL);

openTrade(OP_BUY);

}

}

}

}

if (newBarOpen() || !Enable_OpenTrade) {

if (LTR_check() && LTB_check() && LTTPR_check()) {

if ((iHigh(Symbol(), 0, gi_536) - iLow(Symbol(), 0, gi_536)) / Point < SignalCandle_Size || SignalCandle_Size <= 0) {

if ((getArrowStatus() == "dn" && tol == 1) || (getArrowStatus() == "dn" && getTCCIStatus(1) == "dn" && tol == 2) || (getArrowStatus() == "dn" && getTCCIStatus(1) == "dn" &&

StringFind(getuTCCIStatus(UpperTF), "dn", 0) >= 0 && tol == 3) || (getArrowStatus() == "dn" || getTCCIStatus() == "new dn" && tol == 4) || (getArrowStatus() == "dn" ||

getTCCIStatus() == "new dn" || StringFind(getuTCCIStatus(UpperTF), "dn", 0) >= 0 && tol == 5)) {

closeTrade(OP_BUY);

openTrade(OP_SELL);

}

}

}

}

gi_536 = close_arrow_confirm;

gi_540 = close_tcci_confirm;

if (OrderSelect(getTicketID(), SELECT_BY_TICKET, MODE_TRADES)) {

if (OrderCloseTime() == 0) {

if (newBarOpen() || !Enable_CloseTrade) {

if (OrderType() == OP_BUY) {

if ((getArrowStatus() == "dn" && tcl == 1) || (getTCCIStatus(1) == "dn" && tcl == 2) || (getArrowStatus() == "dn" && getTCCIStatus(1) == "dn" && tcl == 3) || (getArrowStatus() == "dn" &&

getTCCIStatus(1) == "dn" && StringFind(getuTCCIStatus(UpperTF), "dn", 0) >= 0 && tcl == 4) || (getArrowStatus() == "dn" || getTCCIStatus(1) == "dn" && tcl == 5) ||

(getArrowStatus() == "dn" || getTCCIStatus(1) == "dn" || StringFind(getuTCCIStatus(UpperTF), "dn", 0) >= 0 && tcl == 6)) {

closeTrade(OP_BUY);

if (alwaysReverse) openTrade(OP_SELL);

return (0);

}

}

if (OrderType() == OP_SELL) {

if ((getArrowStatus() == "up" && tcl == 1) || (getTCCIStatus(1) == "up" && tcl == 2) || (getArrowStatus() == "up" && getTCCIStatus(1) == "up" && tcl == 3) || (getArrowStatus() == "up" &&

getTCCIStatus(1) == "up" && StringFind(getuTCCIStatus(UpperTF), "up", 0) >= 0 && tcl == 4)) {

closeTrade(OP_SELL);

if (alwaysReverse) openTrade(OP_BUY);

return (0);

}

}

}

}

}

if (!Enable_StealthMode && OrderSelect(getTicketID(), SELECT_BY_TICKET) && OrderCloseTime() == 0 && TS_Enabled) {

if (OrderType() == OP_BUY)

if (OrderStopLoss() < Bid - Point * Set_TS) OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * Set_TS, OrderTakeProfit(), 0, Black);

if (OrderType() == OP_SELL)

if (OrderStopLoss() > Ask + Point * Set_TS || OrderStopLoss() == 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * Set_TS, OrderTakeProfit(), 0, Black);

}

if (Enable_StealthMode && OrderSelect(getTicketID(), SELECT_BY_TICKET) && OrderCloseTime() == 0 && TS_Enabled) {

if (OrderType() == OP_BUY)

if (gd_528 < Bid - Point * Set_TS) gd_528 = Bid - Point * Set_TS;

if (OrderType() == OP_SELL)

if (gd_528 > Ask + Point * Set_TS || gd_528 == 0.0) gd_528 = Ask + Point * Set_TS;

}

if (Enable_StealthMode && OrderSelect(getTicketID(), SELECT_BY_TICKET) && OrderCloseTime() == 0) {

if (OrderType() == OP_BUY && Bid <= gd_512 || Bid >= gd_520 && TS_Enabled == FALSE) closeTrade(OP_BUY);

if (OrderType() == OP_SELL && Ask >= gd_512 || Ask <= gd_520 && TS_Enabled == FALSE) closeTrade(OP_SELL);

if (OrderType() == OP_BUY && Bid <= gd_528 && TS_Enabled) closeTrade(OP_BUY);

if (OrderType() == OP_SELL && Ask >= gd_528 && TS_Enabled) closeTrade(OP_SELL);

}

g_datetime_544 = Time[0];

return (0);

}

 

int LTTPR_check() {

int li_0;

int li_4;

double l_icustom_8;

double l_icustom_16;

double ld_24;

double ld_32;

if (Enable_TVM) {

li_0 = adj(gi_540);

li_4 = 0;

l_icustom_8 = 0;

l_icustom_16 = 0;

ld_24 = 0;

ld_32 = 9999;

while (Bars > li_0 && lttpr_bars_to_check <= 0 || lttpr_bars_to_check <= 0 && li_4 <= lttpr_bars_to_check) {

l_icustom_8 = iCustom(Symbol(), 0, "TCCI", Price, Length, Displace, Filter, Color, ColorBarBack, Deviation, 1, li_0);

l_icustom_16 = iCustom(Symbol(), 0, "TCCI", Price, Length, Displace, Filter, Color, ColorBarBack, Deviation, 2, li_0);

if (direction(l_icustom_8)) {

ld_24 = MathMax(ld_24, l_icustom_8);

ld_32 = MathMin(ld_32, l_icustom_8);

} else {

if (direction(l_icustom_16)) {

ld_24 = MathMax(ld_24, l_icustom_16);

ld_32 = MathMin(ld_32, l_icustom_16);

}

}

if (direction(l_icustom_8) && direction(l_icustom_16) && lttpr_bars_to_check <= 0) {

if ((ld_24 - ld_32) / Point >= TVM_Value) break;

return (0);

}

li_0 = adj(li_0);

li_4 = adj(li_4);

}

}

return (1);

}

 

int LTR_check() {

int li_0;

int li_4;

double l_icustom_8;

double l_icustom_16;

double ld_24;

double ld_32;

if (Enable_MPM) {

li_0 = adj(gi_540);

li_4 = 0;

l_icustom_8 = 0;

l_icustom_16 = 0;

ld_24 = 0;

ld_32 = 9999;

while (Bars > li_0 && ltr_bars_to_check > 0 || ltr_bars_to_check <= 0 && li_4 <= ltr_bars_to_check) {

l_icustom_8 = iCustom(Symbol(), 0, "TCCI", Price, Length, Displace, Filter, Color, ColorBarBack, Deviation, 1, li_0);

l_icustom_16 = iCustom(Symbol(), 0, "TCCI", Price, Length, Displace, Filter, Color, ColorBarBack, Deviation, 2, li_0);

ld_24 = MathMax(ld_24, iHigh(Symbol(), 0, li_0));

ld_32 = MathMin(ld_32, iLow(Symbol(), 0, li_0));

if (direction(l_icustom_8) && direction(l_icustom_16) && lttpr_bars_to_check <= 0) {

if ((ld_24 - ld_32) / Point >= MPM_Pips) break;

return (0);

}

li_0 = adj(li_0);

}

}

return (1);

}

 

int LTB_check() {

int li_0;

double l_icustom_4;

double l_icustom_12;

if (Enable_MLTT) {

li_0 = 3;

l_icustom_4 = 0;

l_icustom_12 = 0;

while (Bars > li_0) {

l_icustom_4 = iCustom(Symbol(), 0, "TCCI", Price, Length, Displace, Filter, Color, ColorBarBack, Deviation, 1, li_0);

l_icustom_12 = iCustom(Symbol(), 0, "TCCI", Price, Length, Displace, Filter, Color, ColorBarBack, Deviation, 2, li_0);

if (direction(l_icustom_4) && direction(l_icustom_12)) {

if (li_0 >= MLTT_Length) break;

return (0);

}

li_0 = adj(li_0);

}

}

return (1);

}

 

string getArrowStatus() {

double l_icustom_0 = 0;

double l_icustom_8 = 0;

l_icustom_0 = iCustom(Symbol(), 0, "GoldTradePro", 0, 0, gi_536);

l_icustom_8 = iCustom(Symbol(), 0, "GoldTradePro", 0, 1, gi_536);

if (direction(l_icustom_0)) return ("up");

if (direction(l_icustom_8)) return ("dn");

return ("na");

}

 

string getTCCIStatus(bool ai_0 = FALSE) {

int l_timeframe_4 = 0;

double l_icustom_8 = iCustom(Symbol(), l_timeframe_4, "TCCI", Price, Length, Displace, Filter, Color, ColorBarBack, Deviation, 1, gi_540);

double l_icustom_16 = iCustom(Symbol(), l_timeframe_4, "TCCI", Price, Length, Displace, Filter, Color, ColorBarBack, Deviation, 2, gi_540);

if (direction(l_icustom_8) && l_icustom_16 == EMPTY_VALUE) return ("up");

if (l_icustom_8 == EMPTY_VALUE && direction(l_icustom_16)) return ("dn");

if (direction(l_icustom_8) && l_icustom_16 != EMPTY_VALUE) {

l_icustom_8 = iCustom(Symbol(), l_timeframe_4, "TCCI", Price, Length, Displace, Filter, Color, ColorBarBack, Deviation, 1, ndj(gi_540));

l_icustom_16 = iCustom(Symbol(), l_timeframe_4, "TCCI", Price, Length, Displace, Filter, Color, ColorBarBack, Deviation, 2, ndj(gi_540));

if (l_icustom_8 != EMPTY_VALUE && l_icustom_16 == EMPTY_VALUE) {

if (ai_0) return ("up");

return ("new up");

}

if (l_icustom_8 == EMPTY_VALUE && l_icustom_16 != EMPTY_VALUE) {

if (ai_0) return ("dn");

return ("new dn");

}

}

return ("");

}

 

string getuTCCIStatus(int a_timeframe_0 = 0) {

double l_icustom_4 = iCustom(Symbol(), a_timeframe_0, "TCCI", uPrice, uLength, uDisplace, uFilter, uColor, uColorBarBack, uDeviation, 1, gi_540);

double l_icustom_12 = iCustom(Symbol(), a_timeframe_0, "TCCI", uPrice, uLength, uDisplace, uFilter, uColor, uColorBarBack, uDeviation, 2, gi_540);

if (l_icustom_4 != EMPTY_VALUE && l_icustom_12 == EMPTY_VALUE) return ("up");

if (l_icustom_4 == EMPTY_VALUE && l_icustom_12 != EMPTY_VALUE) return ("dn");

if (l_icustom_4 != EMPTY_VALUE && l_icustom_12 != EMPTY_VALUE) {

l_icustom_4 = iCustom(Symbol(), a_timeframe_0, "TCCI", uPrice, uLength, uDisplace, uFilter, uColor, uColorBarBack, uDeviation, 1, ndj(gi_540));

l_icustom_12 = iCustom(Symbol(), a_timeframe_0, "TCCI", uPrice, uLength, uDisplace, uFilter, uColor, uColorBarBack, uDeviation, 2, ndj(gi_540));

if (l_icustom_4 != EMPTY_VALUE && l_icustom_12 == EMPTY_VALUE) return ("new up");

if (l_icustom_4 == EMPTY_VALUE && l_icustom_12 != EMPTY_VALUE) return ("new dn");

}

return ("");

}

 

int openTrade(int a_cmd_0) {

double l_price_4;

double l_price_12;

int l_ticket_20;

double l_price_24;

double l_price_32;

int l_ticket_40;

if (!IsTradeTime(TimeCurrent())) return (0);

if (a_cmd_0 == OP_BUY) {

if (getLastHistory(a_cmd_0) == 0 || (OrderSelect(getLastHistory(a_cmd_0), SELECT_BY_TICKET, MODE_HISTORY) && iTime(Symbol(), 0, 0) != g_datetime_548)) {

if ((OrderSelect(getTicketID(), SELECT_BY_TICKET) && OrderCloseTime() != 0) || OrderSelect(getTicketID(), SELECT_BY_TICKET) == FALSE) {

l_price_4 = Bid - Set_StopLoss * Point;

l_price_12 = Bid + Set_Limit * Point;

if (Set_StopLoss == 0) l_price_4 = 0;

if (Set_Limit == 0) l_price_12 = 0;

if (TS_Enabled) l_price_4 = 0;

if (Enable_StealthMode) {

gd_512 = l_price_4;

gd_520 = l_price_12;

gd_528 = Bid - Set_TS * Point;

l_price_4 = 0;

l_price_12 = 0;

}

l_ticket_20 = OrderSend(Symbol(), a_cmd_0, CalcLotsVolume(), Ask, Slippage, l_price_4, l_price_12, "GoldTradePro", Magic_No, 0, Black);

if (l_ticket_20 > -1) g_datetime_548 = iTime(Symbol(), 0, 0);

}

}

} else {

if (a_cmd_0 == OP_SELL) {

if (getLastHistory(a_cmd_0) == 0 || (OrderSelect(getLastHistory(a_cmd_0), SELECT_BY_TICKET, MODE_HISTORY) && iTime(Symbol(), 0, 0) != g_datetime_548)) {

if ((OrderSelect(getTicketID(), SELECT_BY_TICKET) && OrderCloseTime() != 0) || OrderSelect(getTicketID(), SELECT_BY_TICKET) == FALSE) {

l_price_24 = Ask + Set_StopLoss * Point;

l_price_32 = Ask - Set_Limit * Point;

if (Set_StopLoss == 0) l_price_24 = 0;

if (Set_Limit == 0) l_price_32 = 0;

if (TS_Enabled) l_price_24 = 0;

if (Enable_StealthMode) {

gd_512 = l_price_24;

gd_520 = l_price_32;

gd_528 = Ask + Set_TS * Point;

l_price_24 = 0;

l_price_32 = 0;

}

l_ticket_40 = OrderSend(Symbol(), a_cmd_0, CalcLotsVolume(), Bid, Slippage, l_price_24, l_price_32, "TCCI", Magic_No, 0, Black);

if (l_ticket_40 > -1) g_datetime_548 = iTime(Symbol(), 0, 0);

}

}

}

}

return (0);

}

 

int closeTrade(int a_cmd_0) {

if (OrderSelect(getTicketID(), SELECT_BY_TICKET) && OrderCloseTime() == 0 && a_cmd_0 == OrderType()) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, Black);

if (OrderSelect(getTicketID(), SELECT_BY_TICKET) && OrderCloseTime() == 0 && a_cmd_0 == OrderType()) OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, Black);

return (0);

}

 

bool IsTradeTime(int ai_0) {

int li_4;

int li_8;

int l_hour_12 = TimeHour(ai_0);

int l_minute_16 = TimeMinute(ai_0);

if (starthour == stophour && startmin == stopmin) return (TRUE);

if (stopmin == 0) {

if (stophour == 0) li_4 = 23;

else li_4 = stophour - 1;

li_8 = 59;

} else {

li_4 = stophour;

li_8 = ndj(stopmin);

}

if (starthour == li_4) {

if (startmin == li_8) return (TRUE);

if (startmin < li_8) {

if (l_hour_12 != starthour) return (FALSE);

if (l_minute_16 < startmin || l_minute_16 > li_8) return (FALSE);

return (TRUE);

}

if (startmin > li_8) {

if (l_hour_12 == starthour)

if (l_minute_16 < startmin && l_minute_16 > li_8) return (FALSE);

return (TRUE);

}

}

if (starthour < li_4) {

if (l_hour_12 < starthour || l_hour_12 > li_4) return (FALSE);

if (l_hour_12 == starthour && l_minute_16 < startmin) return (FALSE);

if (l_hour_12 == li_4 && l_minute_16 > li_8) return (FALSE);

return (TRUE);

}

if (starthour > li_4) {

if (l_hour_12 < starthour && l_hour_12 > li_4) return (FALSE);

if (l_hour_12 == starthour && l_minute_16 < startmin) return (FALSE);

if (l_hour_12 == li_4 && l_minute_16 > li_8) return (FALSE);

return (TRUE);

}

return (TRUE);

}

 

int getTicketID() {

int l_pos_0 = 0;

for (l_pos_0 = 0; l_pos_0 < OrdersTotal(); l_pos_0++) {

if (OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES))

if (OrderMagicNumber() == Magic_No) return (OrderTicket());

}

return (0);

}

 

int newBarOpen() {

if (g_datetime_544 != iTime(Symbol(), 0, 0)) return (1);

return (0);

}

 

double CalcLotsVolume() {

double ld_ret_0;

double l_maxlot_8;

double l_minlot_16;

double l_lotstep_24;

if (LotSize > 0.0) ld_ret_0 = NormalizeLot(LotSize, 0, "");

else {

l_maxlot_8 = MarketInfo(Symbol(), MODE_MAXLOT);

l_minlot_16 = MarketInfo(Symbol(), MODE_MINLOT);

l_lotstep_24 = MarketInfo(Symbol(), MODE_LOTSTEP);

ld_ret_0 = NormalizeDouble(MathFloor(AccountFreeMargin() * LotSizeBasedOnMargin / 100.0 / (MarketInfo(Symbol(), MODE_MARGINREQUIRED) * l_lotstep_24)) * l_lotstep_24, 2);

if (ld_ret_0 < l_minlot_16) ld_ret_0 = l_minlot_16;

if (ld_ret_0 > l_maxlot_8) ld_ret_0 = l_maxlot_8;

}

if (ld_ret_0 > gi_560) ld_ret_0 = gi_560;

if (MartingaleMultiple > 0) {

for (int l_hist_total_32 = OrdersHistoryTotal(); l_hist_total_32 > 0; l_hist_total_32--) {

if (OrderSelect(l_hist_total_32, SELECT_BY_POS, MODE_HISTORY)) {

if (OrderMagicNumber() == Magic_No) {

if (OrderProfit() < 0.0) return (OrderLots() * MartingaleMultiple);

return (ld_ret_0);

}

}

}

}

return (ld_ret_0);

}

 

double NormalizeLot(double ad_0, bool ai_8 = FALSE, string a_symbol_12 = "") {

double ld_ret_20;

double ld_28;

if (a_symbol_12 == "" || a_symbol_12 == "0") a_symbol_12 = Symbol();

double l_lotstep_36 = MarketInfo(a_symbol_12, MODE_LOTSTEP);

double l_minlot_44 = MarketInfo(a_symbol_12, MODE_MINLOT);

double l_maxlot_52 = MarketInfo(a_symbol_12, MODE_MAXLOT);

if (l_minlot_44 == 0.0) l_minlot_44 = 0.1;

if (l_maxlot_52 == 0.0) l_maxlot_52 = 100;

if (l_lotstep_36 > 0.0) ld_28 = 1 / l_lotstep_36;

else ld_28 = 1 / l_minlot_44;

if (ai_8) ld_ret_20 = MathCeil(ad_0 * ld_28) / ld_28;

else ld_ret_20 = MathFloor(ad_0 * ld_28) / ld_28;

if (ld_ret_20 < l_minlot_44) ld_ret_20 = l_minlot_44;

if (ld_ret_20 > l_maxlot_52) ld_ret_20 = l_maxlot_52;

return (ld_ret_20);

}

 

int getLastHistory(int ai_unused_0) {

int l_pos_4 = 0;

int l_ticket_8 = 0;

for (l_pos_4 = 0; l_pos_4 < OrdersHistoryTotal(); l_pos_4++) {

if (OrderSelect(l_pos_4, SELECT_BY_POS, MODE_HISTORY))

if (OrderMagicNumber() == Magic_No) l_ticket_8 = OrderTicket();

}

return (l_ticket_8);

}

 

-- 06 Jul 2009, 22:57 --

 

can anyone share "backbone.dll"

Link to comment
Share on other sites

  • 3 weeks later...
  • 5 weeks later...
  • 1 year later...
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...