Hi,
I am new to ForexTester (which appears to be an excellent product) and have a few questions regarding indicator conversion from MT4 format.
1. In MT4, as I understand it the IndicatorCounted() function returns the number of bars already calculated by the indicator. Using this allows one to programatically ensure only new bars are re-calculated on each tick.
Is it necessary to apply a similar strategy when creating an FT indicator?
If I didn't, would every bar in the chart be recalculated on every tick (or bar)?
2. Are there any steps necessary when programming an indicator to ensure there are no issues when stepping 'backwards' in a chart using the BackSpace key?
3. Can you recommend a good reference for Delphi programming? I did a little Pascal about 15years ago and have only really used VB since then so am a little rusty.
Many thanks.
Steve
Converting indicators from MT4 to FT format (Delphi)
-
- Posts: 151
- Joined: Tue Feb 24, 2009 1:03 pm
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
Re: Converting indicators from MT4 to FT format (Delphi)
dackjaniels wrote:Hi,
I am new to ForexTester (which appears to be an excellent product) and have a few questions regarding indicator conversion from MT4 format.
1. In MT4, as I understand it the IndicatorCounted() function returns the number of bars already calculated by the indicator. Using this allows one to programatically ensure only new bars are re-calculated on each tick.
Is it necessary to apply a similar strategy when creating an FT indicator?
If I didn't, would every bar in the chart be recalculated on every tick (or bar)?
2. Are there any steps necessary when programming an indicator to ensure there are no issues when stepping 'backwards' in a chart using the BackSpace key?
3. Can you recommend a good reference for Delphi programming? I did a little Pascal about 15years ago and have only really used VB since then so am a little rusty.
Many thanks.
Steve
1. The difference with MT in programming indicator - you do not need to worry about order of calculating and cycle through bars. When you get info Calculate procedure it gives you index of a bar needed to be recalculated. You need to calculate only this bar, Forex Tester will care about calling this procedure for all not calculated bars in correct order.
2. no steps required
3. Really I can not, because my sources are mainly help and google.
Hasta la vista
Mike
Mike
-
- Posts: 151
- Joined: Tue Feb 24, 2009 1:03 pm
Hi Mike,
Many thanks for your clear reply.
Whilst creating an indicator based on moving averages utilising the GetMA function I came across a problem.
I created two MA's as follows...
Period 5, EMA, apply to close
Period 8, EMA apply to open
I noticed in testing that the MA lines were not consistent and eventually confirmed the following: When the indicator was dropped onto a chart containing data the lines were drawn correctly. However, when I pressed 'Connect' and ran the data through in accellerated 'real time' the faster EMA (period 5) was calculated according to OPEN rather than close.
In the GetMA statements I had used the ma_EMA, pt_open and pt_close terms to pass the required info.
I then regsitered options for the pricetype and MAType and used the following terms in the GetMA function call......TMAType(FastMAtype), TPriceType(FastApplyToPrice).
This time it worked fine, both on populated charts and in accelerated 'real time' mode.
Was I incorrect to use pt_open, pt_close and ma_EMA in my original attempt or is this perhaps a program bug?
Best regards and keep up the good work, version 2 has some great improvements, looking forward to its first retail release.
Steve
Many thanks for your clear reply.
Whilst creating an indicator based on moving averages utilising the GetMA function I came across a problem.
I created two MA's as follows...
Period 5, EMA, apply to close
Period 8, EMA apply to open
I noticed in testing that the MA lines were not consistent and eventually confirmed the following: When the indicator was dropped onto a chart containing data the lines were drawn correctly. However, when I pressed 'Connect' and ran the data through in accellerated 'real time' the faster EMA (period 5) was calculated according to OPEN rather than close.
In the GetMA statements I had used the ma_EMA, pt_open and pt_close terms to pass the required info.
I then regsitered options for the pricetype and MAType and used the following terms in the GetMA function call......TMAType(FastMAtype), TPriceType(FastApplyToPrice).
This time it worked fine, both on populated charts and in accelerated 'real time' mode.
Was I incorrect to use pt_open, pt_close and ma_EMA in my original attempt or is this perhaps a program bug?
Best regards and keep up the good work, version 2 has some great improvements, looking forward to its first retail release.
Steve
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
dackjaniels wrote:Hi Mike,
Many thanks for your clear reply.
Whilst creating an indicator based on moving averages utilising the GetMA function I came across a problem.
I created two MA's as follows...
Period 5, EMA, apply to close
Period 8, EMA apply to open
I noticed in testing that the MA lines were not consistent and eventually confirmed the following: When the indicator was dropped onto a chart containing data the lines were drawn correctly. However, when I pressed 'Connect' and ran the data through in accellerated 'real time' the faster EMA (period 5) was calculated according to OPEN rather than close.
In the GetMA statements I had used the ma_EMA, pt_open and pt_close terms to pass the required info.
I then regsitered options for the pricetype and MAType and used the following terms in the GetMA function call......TMAType(FastMAtype), TPriceType(FastApplyToPrice).
This time it worked fine, both on populated charts and in accelerated 'real time' mode.
Was I incorrect to use pt_open, pt_close and ma_EMA in my original attempt or is this perhaps a program bug?
Best regards and keep up the good work, version 2 has some great improvements, looking forward to its first retail release.
Steve
Without seeing the code I can not say anything.
Hasta la vista
Mike
Mike
-
- Posts: 151
- Joined: Tue Feb 24, 2009 1:03 pm
ghamm wrote:If you post the code, we can take a look and try and help, hard to guess
Hi,
I've overwritten the code with the working version now so not to worry. I have a few more indicators to create so am sure I will be back for more advice very soon.
In fact, to start with, can you tell me if there is a stochastic function in Forex Tester (similar to iStochastic function in MT4)?
Thanks,
Steve
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
dackjaniels wrote:ghamm wrote:If you post the code, we can take a look and try and help, hard to guess
Hi,
I've overwritten the code with the working version now so not to worry. I have a few more indicators to create so am sure I will be back for more advice very soon.
In fact, to start with, can you tell me if there is a stochastic function in Forex Tester (similar to iStochastic function in MT4)?
Thanks,
Steve
There is no such functions. But source codes of all indicators are available in Examples/Indicators/Delphi/IndicatorsSrc/
Hasta la vista
Mike
Mike
-
- Posts: 151
- Joined: Tue Feb 24, 2009 1:03 pm
Who is online
Users browsing this forum: No registered users and 19 guests