stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

How to re-Order an array from Forex Robot
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=568
Page 1 of 1
Author:  lucklogic [ Thu May 17, 2012 7:02 pm ]
Post subject:  How to re-Order an array from Forex Robot

The following code was taken from Forex Robot developed by Dietcoke , this part of the EA deals with establishing an array list of pairs of interest

void CreateSymbolList()
{
int hFileName = FileOpenHistory("symbols.raw",FILE_BIN|FILE_READ);
int Records = FileSize(hFileName) / 1936;
int Counter = 0;
for(int i = 0; i < Records; i++)
{
string TempSymbol = StringTrimLeft(StringTrimRight(FileReadString(hFileName,12)));
if(MarketInfo(TempSymbol,MODE_BID) > 0 && PairAllowed(TempSymbol))
{
if( StringFind(Ignore.Pair,TempSymbol,0) < 0 && IndexAllowed(TempSymbol) )
{
ArrayResize(Pairs,Counter+1);
Pairs[Counter] = TempSymbol;
if(TempSymbol == Symbol()) ThisSymbolIndex = Counter;
//log("ThisSymbolIndex",ThisSymbolIndex,Pairs[ThisSymbolIndex]);
//log("CreateSymbolList: Counter=",Counter,TempSymbol,Symbol());
Counter++;
}
}
FileSeek(hFileName,1924,SEEK_CUR);
}
FileClose(hFileName);
return(0);
}


But lets say we want to introduce a RSI daily 20 period progesssion and we wanted to rank the pairs not alphabetically as above, but by RSI decending values - NOW How would I do that ??? :roll:
Author:  lucklogic [ Sat May 19, 2012 4:49 pm ]
Post subject:  Re: How to re-Order an array from Forex Robot

Nobody helped me here but luckily for me, they did on Forex Factory :lol:
Author:  dietcoke [ Fri Jun 01, 2012 12:08 pm ]
Post subject:  Re: How to re-Order an array from Forex Robot

lucklogic wrote:
But lets say we want to introduce a RSI daily 20 period progesssion and we wanted to rank the pairs not alphabetically as above, but by RSI decending values - NOW How would I do that ??? :roll:
Sorry I never saw this, I would have helped. Its a problem I've noticed with FR. It doesn't always open the pair you really want it to.

Is there any chance you can share the solution you ended up with and I'll tray and incorporate it into the main bot?
Author:  mobthehop [ Fri Jun 01, 2012 12:43 pm ]
Post subject:  Re: How to re-Order an array from Forex Robot

lucklogic - could you please share the code so that we all can learn...

Cheers
Author:  lucklogic [ Sat Jun 09, 2012 6:28 pm ]
Post subject:  Re: How to re-Order an array from Forex Robot

mobthehop wrote:lucklogic - could you please share the code so that we all can learn...

Cheers

Look at the stuff Baluda is doing in the 10.2 thread, its a step up levels better than anything that I found previously and is doing exactly what is required;- 8-) re-ordering arrays
Author:  SteveHopwood [ Sat Jun 09, 2012 9:21 pm ]
Post subject:  Re: How to re-Order an array from Forex Robot

lucklogic wrote:Nobody helped me here but luckily for me, they did on Forex Factory :lol:
There is a lot of expertise available at FF. Glad you found a solution.

I am not surprised that nobody here could or would help; most of those who could help are a tad busy. The way in which you presented your code did not make reading it easy. When you want people to read your code, you need to present it in a readable form. In future, when posting code that you want people to read, enclose it within the Code tabs available here to preserve the formatting.

Whether or not I would have been able to help you originally, I would not have taken the trouble to plough through your code as presented here. Others may be more patient than me, but I would not count on it.

I am not sure that I have the tone of my post right. I am not intending to be critical and am trying to point out how you might attract a better response in the future. My apologies if I come across as overly critical; this is not what I intend.

Cheers

:D
All times are UTC Page 1 of 1