Forex Forum - EarnForex
Serving Traders Since 2005
 

Go Back   Forex Forum - EarnForex > MetaTrader > MetaTrader 5

MetaTrader 5 MT5 is already out of its beta stage, but the development is ongoing. Some brokers already offer real accounts and the interest of traders is growing. You can discuss anything related to MetaTrader 5 in this forum.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 3rd January 2012, 00:30
Default Avatar
Senior Member
 
Join Date: Aug 2011
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Default binary data assignment

Hi again

I am not sure how to get MT5 to do this.

MQL5 Code:
            string s1="0110001";
            string s2="0010101";
            string s3=s1^s2;

I expecting 0100100
many thx
Reply With Quote
  #2 (permalink)  
Old 3rd January 2012, 10:30
Enivid's Avatar
Administrator
 
Join Date: Nov 2008
Posts: 1,542
Thanks: 18
Thanked 20 Times in 16 Posts
Default

First, 0110001^0010101 = 0010001, not 0100100.
Second, you can't use strings for that. Have to use integers and only decimal or hex form. For example:
MQL5 Code:
int a = 49;
int b = 21;
int c = a ^ b; // Should return 17.
or:
MQL5 Code:
int a = 0x31;
int b = 0x15;
int c = a ^ b; // Should return 0x11.
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account.
Reply With Quote
  #3 (permalink)  
Old 3rd January 2012, 11:12
Default Avatar
Senior Member
 
Join Date: Aug 2011
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Enivid View Post
First, 0110001^0010101 = 0010001, not 0100100.

[/HIGHLIGHT]
isn't ^ mean xor? which is
Input Output
A B
0 0 0
0 1 1
1 0 1
1 1 0
??

thx
Reply With Quote
  #4 (permalink)  
Old 3rd January 2012, 17:17
Enivid's Avatar
Administrator
 
Join Date: Nov 2008
Posts: 1,542
Thanks: 18
Thanked 20 Times in 16 Posts
Default

Oops, sorry. Confused it with "&" .
__________________
Please, read the Forum Rules and the Signature Rules to avoid termination of your account.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binary Options Daily Analysis – Western Markets Soar on Upbeat Data BinaryOptionStrategy Commodities and Stocks 0 21st December 2011 15:52
Binary Options Analysis – Weak Chinese PMI Data Hits Equities BinaryOptionStrategy Commodities and Stocks 0 24th November 2011 07:21
Binary Options Analysis – Upbeat Economic Data Lifts US Markets BinaryOptionStrategy Commodities and Stocks 0 16th November 2011 08:30
Binary Options Analysis – Stocks Mixed as US Payroll Data Disappoints BinaryOptionStrategy Commodities and Stocks 0 7th November 2011 07:20
Binary Options Analysis – US Payroll Data Stronger than Forecast BinaryOptionStrategy Commodities and Stocks 0 10th October 2011 07:35


All times are GMT. The time now is 10:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Inactive Reminders By Icora Web Design

SEO by vBSEO 3.3.2