How to split a sting with comma and put into an array - EasyLanguage Programming | futures io social day trading
futures io futures trading


How to split a sting with comma and put into an array
Updated: Views / Replies:566 / 9
Created: by huzisg Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

How to split a sting with comma and put into an array

  #1 (permalink)
Trading Apprentice
HANGZHOU,ZHEJIANG,CHINA
 
Futures Experience: Advanced
Platform: Multicharts
Favorite Futures: MC
 
Posts: 5 since Aug 2016
Thanks: 0 given, 0 received

How to split a sting with comma and put into an array

HI, does anyone know how to split a string with comma to an array?

e.g.

str = "111,222,333,444,555"

arr[0] = "111";
arr[1] = "222";
...

thanks!

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,466 since Apr 2013
Thanks: 224 given, 836 received


huzisg,

you should be able to accomplish that with using a while loop and the reserved words for string manipulation i.e.
LeftStr, RightStr, MidStr and InStr is what you can utilize here.
With these you can step through your string from comma to comma.

1. Have your loop check that there are still letters in your test string.
2. Take everything to the left of the first comma and store it in the array.
3. If there is no comma in the string, store the string in the array and set the test string to an empty string (so your loop can be exited).
4. Modify your test string so it now contains only the string to the right of the first comma.
5. You loop will repeat steps 2. to 4. until there is no new comma.

This should give you what you are looking for, but it will involve a bit of programming.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #4 (permalink)
Trading Apprentice
HANGZHOU,ZHEJIANG,CHINA
 
Futures Experience: Advanced
Platform: Multicharts
Favorite Futures: MC
 
Posts: 5 since Aug 2016
Thanks: 0 given, 0 received

So I known that there is no a function like "split" in vb, thanks for you reply.

Reply With Quote
 
  #5 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,466 since Apr 2013
Thanks: 224 given, 836 received

No, unfortunately there isn't, but you should be able to easily accomplish what you have in mind following the four simple steps I described.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #6 (permalink)
Trading Apprentice
Onsala Sweden
 
Futures Experience: Intermediate
Platform: Multichart
Broker/Data: InteractiveBrokers, eSignal
Favorite Futures: OMXS30
 
Posts: 28 since Nov 2016
Thanks: 21 given, 1 received


ABCTG View Post
huzisg,

you should be able to accomplish that with using a while loop and the reserved words for string manipulation i.e.
LeftStr, RightStr, MidStr and InStr is what you can utilize here.
With these you can step through your string from comma to comma.

1. Have your loop check that there are still letters in your test string.
2. Take everything to the left of the first comma and store it in the array.
3. If there is no comma in the string, store the string in the array and set the test string to an empty string (so your loop can be exited).
4. Modify your test string so it now contains only the string to the right of the first comma.
5. You loop will repeat steps 2. to 4. until there is no new comma.

This should give you what you are looking for, but it will involve a bit of programming.

Regards,

ABCTG

Hi,

How do you modify the test string? Is there any "SubStr" function or function which can return the length of a string?

Best regards
Shahram

Reply With Quote
 
  #7 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,466 since Apr 2013
Thanks: 224 given, 836 received

Shahram,

yes, there are. You can find them documented here: https://www.multicharts.com/trading-software/index.php/Category:Text_Manipulation including examples.

 
Code
StrLen( "My String" ) ;
The code above would for example return the length of this string.

Regards,

ABCTG

Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #8 (permalink)
Trading Apprentice
Onsala Sweden
 
Futures Experience: Intermediate
Platform: Multichart
Broker/Data: InteractiveBrokers, eSignal
Favorite Futures: OMXS30
 
Posts: 28 since Nov 2016
Thanks: 21 given, 1 received

Hello,

I want to find and delete character " (shit 2 - ASCII(34)) from a string.
Is there any function like ASCII(34) in EasyLanguage? (Because I can not write the character " in my code.)

EX: How do I write: Instr(MyStr,""") ?

Best Regards


Last edited by ShahramTor; May 1st, 2017 at 03:14 AM.
Reply With Quote
 
  #9 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,466 since Apr 2013
Thanks: 224 given, 836 received

ShahramTor,

take a look at the reserved word DoubleQuote, this might be helpful here.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #10 (permalink)
Trading Apprentice
Onsala Sweden
 
Futures Experience: Intermediate
Platform: Multichart
Broker/Data: InteractiveBrokers, eSignal
Favorite Futures: OMXS30
 
Posts: 28 since Nov 2016
Thanks: 21 given, 1 received



ABCTG View Post
ShahramTor,

take a look at the reserved word DoubleQuote, this might be helpful here.

Regards,

ABCTG

Perfect. Thanks!

Reply With Quote

Reply



futures io > > > > > How to split a sting with comma and put into an array

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

RandBots: AutoTrading Bots to diversify your trading

Oct 24
 

TopstepTrader: Profiting Without Risking Your Own Money

Oct 26

Building Open Source Indicators for NT8 w/Fat Tails @ Lizard Indicators

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
6E with 4 or 5 digits after the comma bart007 Currency Futures 19 January 15th, 2016 10:39 AM
Buyer Beware: Will Your Bond Fund Sting You? Quick Summary News and Current Events 0 December 13th, 2012 06:50 PM
Would-be Jihadist Chicago teenager tries to blow up bar, arrested in FBI sting kbit News and Current Events 0 September 16th, 2012 10:58 AM
here's way to convert tick data from NT to comma-separated format, with Mac or Linux theorist Platforms and Indicators 1 July 1st, 2012 04:00 AM
Why Sanctions Against Iran Might Sting More This Time* Quick Summary News and Current Events 0 December 28th, 2011 05:50 PM


All times are GMT -4. The time now is 06:27 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-10-21 in 0.10 seconds with 19 queries on phoenix via your IP 54.158.55.5