Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

andypap

Array Question

Recommended Posts

hi guys

 

anyone knows how to take evey n elements of a one dimentional array and fille another array..

lets say n is 3.

so element 0,3,6,9,12 etc of the original array will fill the new array

as element 0,1,2,3,4 etc.

 

thanks in advance

Share this post


Link to post
Share on other sites
thanks ehorn but this looks like c

is it possible to writte these lines in easy language

 

Your request seems to imply 0-based array indexing, so this would be your "skip 3" code:

 

vars:
 int indx(0);

arrays:
 srcarr[19](0),  // source array
 dstarr[7](0);   // destination array

// your request said 0-based arrays, so...

for indx = 0 to 6 begin

 dstarr[indx] = srcarr[indx*3];

end;

 

... but, it's better practice in easylanguage to use a 1-based index, because easylanguage's built-in functions have that perspective. So, your source array's 1 4 7 10 etc... would map to your destination 1 2 3 4 etc...

 

vars:
 int indx(0);

arrays:
 srcarr[19](0),  // source array
 dstarr[7](0);   // destination array

// use 1-based indexing this time....

for indx = 1 to 7 begin

 dstarr[indx] = srcarr[indx*3-2];

end;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.


  • Topics

  • Posts

    • This is an absolute truth. You will not become a millionaire in a week. That doesn't happen in forex if you are a small fish like most of people here. Be patient and study as much as possible.
    • Date : 27th March 2020. FX Update – 27 March 2020.USDJPY, H1The Dollar declined and then recovered some of its losses, which saw the narrow trade-weighted USDIndex print a nine-day low at 99.15 before recouping levels back above 99.40. At the lows, the index was showing a correction of 3.2% from the 38-month high that was seen last week, which can be credited to the Fed’s ultra-aggressive dollar printing activity. There has also been a side theme of pronounced losses in USDJPY and Yen crosses, which look out of sync with the usual correlative pattern in light of a backdrop of mostly-higher stock and commodity markets in Asia today (which often times, especially in the prevailing crisis, would be associated with a softening in the Japanese currency). The demand for Yen was reportedly driven by repatriation of Japanese investment funds, according to several market reports and narratives, even though the timing — just a few days before Japan’s financial year end — seems a little strange. USDJPY, aided by broad Dollar weakness, dropped by about another 1% in printing a one-week low at 108.25. EURJPY, AUDJPY and most other Yen crosses declined, too, which amounted to a correction. Subsequently, the Yen gave back up to half of its gains as the European interbank market picked up the reins, and expectations, should risk appetite hold up, the Yen could soften from here. The USDJPY and the crossing EMA strategy (H1) closed out in the last hour as the 9-period EMA was broken at 108.89 from an entry at 111.14 on March 25, a 220 pip move.Elsewhere, EURUSD edged out a 10-day high at 1.1088, before ebbing back under 1.1050. Cable printed an eleven-day high, at 1.2306. As for the coronavirus, the exponential rate of new cases has continued. Cases in the US have surged, and it might be several weeks before the fruits of the global lockdown is seen. Few are now expecting a V-shaped economic recovery out of this, such as was seen following the SARS epidemic in Asia in 2003. The key question is how wide the “U” will be in a U-shaped recovery? An old market adage has always been to, never try to catch a falling knife.Always trade with strict risk management. Your capital is the single most important aspect of your trading business.Please note that times displayed based on local time zone and are from time of writing this report.Click HERE to access the full HotForex Economic calendar.Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE!Click HERE to READ more Market news. Stuart Cowell Head Market Analyst HotForex Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • No any trader can become a successful trader over a night, it requires good experience with accurate skills and powerful mind to trade in such an volatility market like FOREX. For a new user Demo account is route towards successful trade into real market.
    • No any trader can become a successful trader over a night, it requires good experience with accurate skills and powerful mind to trade in such an volatility market like FOREX. For a new user Demo account is route towards successful trade into real market.
    • All you need for a trade market is Knowledge, skills, learning attitude, not having fear to fail instead learn from it and never repeating again, having a powerful mind to strategies and analyse the situations going in market.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.