MT4 Files

Check-in [ec6e2b4d90]
Login

Check-in [ec6e2b4d90]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added dumping code to avoid unpredictable binding error
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ec6e2b4d902340cc1a9dfc1997f548457393da5a
User & Date: onagano 2011-04-25 03:19:10.000
Context
2011-04-25
07:09
Improved copy rates function check-in: e8e4df9262 user: onagano tags: trunk
03:19
Added dumping code to avoid unpredictable binding error check-in: ec6e2b4d90 user: onagano tags: trunk
2011-04-22
11:16
Cosmetic fix check-in: 9238abeea9 user: onagano tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to experts/MOB_executeOrder.mq4.
855
856
857
858
859
860
861





















862
863
864
865
866
867
868
   trdCommission[0]  = OrderCommission();
   trdSwap[0]        = OrderSwap();
   trdProfit[0]      = OrderProfit();
   trdExpiration[0]  = OrderExpiration();
   trdMagicNumber[0] = OrderMagicNumber();
   mob_strcpy(trdComment, trdCommentSize, OrderComment());
}






















int dumpTrades(bool history) {
   int rc = 0;
   int truncateStmt;
   int insertStmt;
   int n;
   int pool;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
   trdCommission[0]  = OrderCommission();
   trdSwap[0]        = OrderSwap();
   trdProfit[0]      = OrderProfit();
   trdExpiration[0]  = OrderExpiration();
   trdMagicNumber[0] = OrderMagicNumber();
   mob_strcpy(trdComment, trdCommentSize, OrderComment());
}

void dumpTradeParameters(string mesg) {
   Print(mesg, ": ",
      trdTicket[0], ", ",
      TimeToStr(trdOpenTime[0]), ", ",
      trdType[0], ", ",
      trdLots[0], ", ",
      trdSymbol, ", ",
      trdOpenPrice[0], ", ",
      trdStopLoss[0], ", ",
      trdTakeProfit[0], ", ",
      TimeToStr(trdCloseTime[0]), ", ",
      trdClosePrice[0], ", ",
      trdCommission[0], ", ",
      trdSwap[0], ", ",
      trdProfit[0], ", ",
      TimeToStr(trdExpiration[0]), ", ",
      trdMagicNumber[0], ", ",
      trdComment
   );
}

int dumpTrades(bool history) {
   int rc = 0;
   int truncateStmt;
   int insertStmt;
   int n;
   int pool;
883
884
885
886
887
888
889

890
891
892
893
894
895
896
   if (rc < 0) {
      getDatabaseResponse();
      return (rc);
   }
   for (int i = 0; i < n; i++) {
      if (OrderSelect(i, SELECT_BY_POS, pool)) {
         bindTradeParameters();

         rc = mob_executeStatement(insertStmt);
         if (rc < 0) {
            getDatabaseResponse();
            return (rc);
         }
      } else {
         getServerResponse();







>







904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
   if (rc < 0) {
      getDatabaseResponse();
      return (rc);
   }
   for (int i = 0; i < n; i++) {
      if (OrderSelect(i, SELECT_BY_POS, pool)) {
         bindTradeParameters();
         dumpTradeParameters("dumpTrades-" + history);
         rc = mob_executeStatement(insertStmt);
         if (rc < 0) {
            getDatabaseResponse();
            return (rc);
         }
      } else {
         getServerResponse();