Appreciation... and a question

Indicators coded by community members
Message
Author
david070o
Posts: 28
Joined: Mon Mar 19, 2007 8:13 pm

Appreciation... and a question

#1 Postby david070o » Wed Apr 18, 2007 9:39 am

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.

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

Re: Appreciation... and a question

#2 Postby Terranin » Wed Apr 18, 2007 10:36 am

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

david070o
Posts: 28
Joined: Mon Mar 19, 2007 8:13 pm

#3 Postby david070o » Mon Apr 23, 2007 10:10 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;

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#4 Postby Terranin » Tue Apr 24, 2007 12:57 am

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.
Hasta la vista

Mike

david070o
Posts: 28
Joined: Mon Mar 19, 2007 8:13 pm

#5 Postby david070o » Wed Apr 25, 2007 9:29 pm

Thanks Mike,

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 915 times

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#6 Postby Terranin » Wed Apr 25, 2007 10:39 pm

What parameter you cannot change?
Hasta la vista

Mike

david070o
Posts: 28
Joined: Mon Mar 19, 2007 8:13 pm

#7 Postby david070o » Fri Apr 27, 2007 9:18 pm

Thanks for the response....
I can't change the currency pair and time frame.

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#8 Postby Terranin » Sat Apr 28, 2007 9:40 am

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?
Hasta la vista

Mike


Return to “Indicators”

Who is online

Users browsing this forum: No registered users and 1 guest