Write a code (c++)

Examples step by step how to make your own automated strategy or user indicator
Message
Author
JimAthens
Posts: 2
Joined: Mon Mar 02, 2015 10:25 am

Write a code (c++)

#1 Postby JimAthens » Mon Mar 02, 2015 10:36 am

Dear All,


I try to write a code (c++) for first time, so to start back testing automatic.

I need your help to move forward.

I would like to write that, if the EMA(16) (Exceptional Moving Average) is bigger than EMA(21) in three different timeframes at the same time.

For example, “Buy” when EMA(16)>EMA(21) in Timeframe (15’) and Timeframe(60’) and Timeframe(240’), at the same time.

My second question is:

Can I find somewhere the indicators for c++ ? I need the exceptional moving average (ΕΜΑ).

General, if someone can send me any strategy programming in c++, it will help me a lot to use the strategy as a guide to write my strategy.


Thank you very much in advance!

Dimitris

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

Re: Write a code (c++)

#2 Postby FX Helper » Tue Mar 03, 2015 5:38 am

Hello,

You can find an example of a strategy in C++ language in C:\ForexTester2\Examples\Strategies\C++ folder (by default).
Sorry, but we don't have a programmers in C++ who can help you, our programmers are writting indicators/strategies on Delphi.

JimAthens
Posts: 2
Joined: Mon Mar 02, 2015 10:25 am

Re: Write a code (c++)

#3 Postby JimAthens » Wed Mar 04, 2015 12:08 pm

Hello again!

Thanks a lot FX Helper!

Could someone explain to me how can program the below in c++ , or Delphi?

""""I would like to write that, if the EMA(16) (Exceptional Moving Average) is bigger than EMA(21) in three different timeframes at the same time.

For example, “Buy” when EMA(16)>EMA(21) in Timeframe (15’) and Timeframe(60’) and Timeframe(240’), at the same time. """

Thank you a lot!

Dimitris

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

Re: Write a code (c++)

#4 Postby FX Helper » Thu Mar 05, 2015 8:36 am

Hello Dimitris,

You need to create a strategy, in this strategy create 6 EMA indicators.

MA1 := CreateIndicator('USDJPY', 15, 'MovingAverage',

format('%d;0;0;%s;Close', [MATrendPeriod, StrMAType(ma_EMA)]));

Then you can check indicator values via function GetIndicatorValue.

You can find description of these functions in Help -> Strategies API menu.

violajsilver
Posts: 5
Joined: Mon May 09, 2016 11:42 pm

Re: Write a code (c++)

#5 Postby violajsilver » Mon May 09, 2016 11:53 pm

Thank you so much for this post. It was really helpful.

fabraz
Posts: 3
Joined: Mon Aug 08, 2016 9:28 am

Re: Write a code (c++)

#6 Postby fabraz » Mon Sep 05, 2016 8:09 pm

Is it possible to share the RSi indicator code? I need an indicator whose behavior is very similar to that, but I dont know how to program the indicator box in the graph botton. Thanks in advance!


Return to “Programming lessons”

Who is online

Users browsing this forum: No registered users and 1 guest