Strategies on charts

How to create strategies and indicators
Message
Author
FXnewbie
Posts: 3
Joined: Fri Mar 13, 2015 9:38 am

Strategies on charts

#1 Postby FXnewbie » Fri Mar 13, 2015 10:21 am

Hi everyone,
at first of all excuse me for my bad english.
I tested the sample strategie in FT2 ObjectsTest.cpp in VisualStudio 2010 and it works fine. I set the parameters of startegie Currency="EURUSD", Timeframe=1, and I made 3 charts with different timeframes. I thought, the strategie will work only on that chart, that has the proper timeframe that I set in parameters dialog, but it does not. The startegie works on all charts, independently of timeframe. But when I changed if (Timeframe != PERIOD_M1) to other PERIOD_M? the strategie not worked. The Print() write constantly Currency="EURUSD" and Timeframe=1 at any chart.

I searched the forum but I did not find any solution or explanation. I think I misunderstand the philosophy of FT2.

Thank you very much in advance for your help

Here is the modified part of the sample program

EXPORT void __stdcall GetSingleTick()
{
char* names[] = {"Line0", "Line1", "Line2", "Line3", "Fibo1",
"Fibo2", "Fibo3", "Fibo4", "Text1"};
char crn[100]; // new var for printed string

SetCurrencyAndTimeframe(Currency, Timeframe);

sprintf_s(crn, "Currency=%s, TimeframeChart=%d", Currency, Timeframe); // create test string

Print(crn); // print test string

if (strcmp(Currency, Symbol()) != 0) return; // if currency not 'EURUSD' then return

if (Timeframe != PERIOD_M1) return; // I could not find function for timeperiod of charts !!!

sprintf_s(crn, "Currency=%s, TimeframeChart=%d", Currency, Timeframe); // create test string

Print(crn); // print test string

if (Bars() < 80) return;
Attachments
charts_1.png
charts_1.png (318.59 KiB) Viewed 15626 times

FX Helper
Posts: 1479
Joined: Mon Apr 01, 2013 3:55 am

Re: Strategies on charts

#2 Postby FX Helper » Wed Mar 18, 2015 10:57 am

Hello,

Strategies in Forex Tester don't attach to any of charts or timeframes, they works separately.

You need to set Timeferame in properties of strategy to pick up necessary values from chart of necessary timeframe.

Also if the strategy uses indicators then strategy will take indicator's values from this timeframe.

FXnewbie
Posts: 3
Joined: Fri Mar 13, 2015 9:38 am

Re: Strategies on charts

#3 Postby FXnewbie » Wed Mar 18, 2015 1:10 pm

Hi FX Helper,

thank you very much for your reply. As my name shows I am beginer in FT2's World :o) and I does not understand enough the funtions. I try to interpret my ask in other words. I would like a strategie that works in certain window (chart) and only in this one.

I would like to create a strategy that works in a short timeframe (M15), and in this timeframe chart it could give me signals to buy or sell, and I would like to display longer charts (H1, H4) with different indicators, but in these windows I do not need to buy-sell signals (the strategy does not have to operate in these windows).

How can I make this in FT2 if it is possible?

I would very thank you if you would answer to me. Sorry for my dummy questions.

Best regards

FX Helper
Posts: 1479
Joined: Mon Apr 01, 2013 3:55 am

Re: Strategies on charts

#4 Postby FX Helper » Fri Mar 20, 2015 9:48 am

Hello,

If you create a strategy and select M15 timeframe in properties of this strategy then this strategy will pick up values only from M15 timeframe. So it will work like the strategy which is attached to M15.
Also this EA can draw text labels on this chart if you want to see them only in this window. Also it is possible to show signals as alerts but they will pop-up like a new small window.

You can contact our programmer by email services@forextester.com and ask him if he can create such strategy for you. Add he can send a strategy and source code of this strategy (in Delphi format) when the job is done.
Please note that we use Delphi for creating indicators and strategies that's why I can't help you with the solution for C++.

FXnewbie
Posts: 3
Joined: Fri Mar 13, 2015 9:38 am

Re: Strategies on charts

#5 Postby FXnewbie » Mon Mar 23, 2015 3:12 pm

Hello,

thank you very much for your reply and advices. I am learning the Forex Tester power and I can't debug my dlls in Delphi 7 but I can do it in MS Visual Studio 10, for this reason C++. Delphi would be pretty and comfortable for me.

Thank you for your proposal to make contact with your programmer I will make the best opportunity.


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 4 guests