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.
Appreciation... and a question
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
Re: Appreciation... and a question
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.
Hasta la vista
Mike
Mike
-
- Posts: 28
- Joined: Mon Mar 19, 2007 8:13 pm
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;
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;
-
- Posts: 28
- Joined: Mon Mar 19, 2007 8:13 pm
Thanks Mike,
I have attached a project file. Note... the problem was I could not change the parameter from the strategy option menu.
I have attached a project file. Note... the problem was I could not change the parameter from the strategy option menu.
- Attachments
-
- EMALSMACorss1_USDCHFStrategy.zip
- (1.52 KiB) Downloaded 917 times
Who is online
Users browsing this forum: No registered users and 0 guests