Page 1 of 1

Appreciation... and a question

Posted: Wed Apr 18, 2007 9:39 am
by david070o
Mike,
First of all, thank you for all your help. You are the best moderator I have seen.

Question: is there a way to record indicator values to a text file? I know the “account history” in “Testing Mode” can be exported as text file. Is there a way I can code it so ForexTester will record the indicator values of my choice and let me export them as a text file.

The reason I want to do this is it would enable me to collect data much quickly and analyze them. Give me some clues, Please.

Thanks.

Re: Appreciation... and a question

Posted: Wed Apr 18, 2007 10:36 am
by Terranin
david070o wrote:Mike,
First of all, thank you for all your help. You are the best moderator I have seen.

Question: is there a way to record indicator values to a text file? I know the “account history” in “Testing Mode” can be exported as text file. Is there a way I can code it so ForexTester will record the indicator values of my choice and let me export them as a text file.

The reason I want to do this is it would enable me to collect data much quickly and analyze them. Give me some clues, Please.

Thanks.


What kind of data would you like to collect?
You can do it by yourself in your own indicator just opening the text file and writing there what you want.

Posted: Mon Apr 23, 2007 10:10 pm
by david070o
Ok...


I was trying to collect the indicator values when the trade is triggered or close. I figure it out to use the text file now.

And another error is that when I change the timeframe from the option window of the strategy, it just got frozen. The only places where i specify the timeframes are in init procedure and reset procedure.... don't know what is causing it.....


procedure InitStrategy; stdcall;
begin
StrategyShortName('CCI Zero Line Reject & EMAUSDCHF1');
StrategyDescription('Test');

// Register external parameters
RegOption('Currency', ot_Currency, Currency);
ReplaceStr(Currency, 'USDCHF');

RegOption('Timeframe', ot_Timeframe, TimeFrame);
TimeFrame := PERIOD_H1;

RegOption('LotSize', ot_Double, LotSize);
SetOptionDigits('LotSize', 1);
lotSize := 0.1;

RegOption('cci period', ot_Integer, period1);
SetOptionRange('cci period', 2, MaxInt);
period1 := 20;

RegOption('EMA period', ot_Integer, emaperiod);
SetOptionRange('EMA period', 2, MaxInt);
emaperiod := 34;

Assignfile (datafile, 'data.txt');
end;

{-----Done strategy----------------------------------------------------------}
procedure DoneStrategy; stdcall;
begin
FreeMem(Currency);
end;

{-----Reset strategy---------------------------------------------------------}
procedure ResetStrategy; stdcall;
begin
//Create Indicater
IndHandler := CreateIndicator('USDCHF', PERIOD_H1, 'CCI', '20');
IndHandler1 := CreateIndicator('USDCHF', PERIOD_H1, 'MovingAverage',
format('%d;%d;%s;%s', [34, 0, StrMAType(ma_EMA), StrPriceType(pt_HL2)]));
OrderHandle := -1;
IndHandler2 := CreateIndicator('USDCHF', PERIOD_H1, 'lsma', '20');

end;

Posted: Tue Apr 24, 2007 12:57 am
by Terranin
Attach the full project file, it is difficult to say something.
In your case it is easier to use Print function and read your values in the Journal.

Posted: Wed Apr 25, 2007 9:29 pm
by david070o
Thanks Mike,

I have attached a project file. Note... the problem was I could not change the parameter from the strategy option menu.

Posted: Wed Apr 25, 2007 10:39 pm
by Terranin
What parameter you cannot change?

Posted: Fri Apr 27, 2007 9:18 pm
by david070o
Thanks for the response....
I can't change the currency pair and time frame.

Posted: Sat Apr 28, 2007 9:40 am
by Terranin
david070o wrote:Thanks for the response....
I can't change the currency pair and time frame.


For me it works just fine. Can you change those parameters for other strategies?