Search found 17 matches

by amberwine
Sun Jul 21, 2013 4:28 am
Forum: Programming lessons
Topic: Lesson 3 - Working with orders
Replies: 10
Views: 40921

Yes, I have had a go at porting a couple of MT4 indicators to FT2 (C++). I've had some success with converting the FXA0 indicator to FT2 (uses RSI and ATR internally), but I've found that the Calculate() function in FT2 seems to behave slightly differently to the start() method in MT4. However, I no...
by amberwine
Fri Jul 19, 2013 6:41 am
Forum: Indicators
Topic: Value of index parameter in Calculate function
Replies: 3
Views: 4737

Thanks, that's clear. A couple of follow-up question, if I may... You point out that each bar can consist of multiple ticks, and presumably the structure of each bar is determined by the selected timeframe. So, if timeframe is set to 4-hours, then there will probably be hundreds of ticks per 4-hourl...
by amberwine
Thu Jul 18, 2013 6:54 am
Forum: Indicators
Topic: Value of index parameter in Calculate function
Replies: 3
Views: 4737

Value of index parameter in Calculate function

I've built the C++ version of the sample Ishimoku indicator and installed it (as Ishimoku2) into FT2. I set a breakpoint at the start of the Calculate function as I wanted to better understand the value and purpose of the index parameter. To trigger the breakpoint, I made a parameter change. OnParam...
by amberwine
Tue Jul 16, 2013 8:41 am
Forum: FT API
Topic: MACD new indicator with CreateIndicator
Replies: 5
Views: 11870

Got it, thanks!

I'm using Vista 64-bit. The folders are in my Users\AppData\Roaming subdirectory.
by amberwine
Tue Jul 16, 2013 6:19 am
Forum: FT API
Topic: MACD new indicator with CreateIndicator
Replies: 5
Views: 11870

Thanks for your help - it worked. I did have a look for dll's before asking the question here but strangely I don't seem to have an Indicators folder under my FT2 installation folder. I'm showing hidden files and subdirectories inside the installation folder but in my installation the only folders t...
by amberwine
Tue Jul 16, 2013 5:24 am
Forum: FT API
Topic: MACD new indicator with CreateIndicator
Replies: 5
Views: 11870

MACD new indicator with CreateIndicator

There is an indicator on the Add a new Indicator... button in FT2 called 'MACD new', different from MACD. This new indicator has the MACD, signal and histogram, whereas the old one just has the signal and histogram (called MACD). I tried creating an instance of this in a C++ strategy using IndMACD =...
by amberwine
Tue Jul 16, 2013 3:46 am
Forum: FT API
Topic: Indicator return value
Replies: 19
Views: 31624

1 - When you call MACDPrevious = GetIndicatorValue(IndMACD, 1, 2) you have the MACD of the last complete M15 bar but you're right, when you call MACDCurrent = GetIndicatorValue(IndMACD, 0, 2) you receive the actual M15 MACD which could change every tick (with BID) I agree, this is what I get in Pas...
by amberwine
Mon Jul 15, 2013 4:42 am
Forum: FT API
Topic: Indicator return value
Replies: 19
Views: 31624

I will do as you suggest and report back. However, could I just ask... when you read the 'previous' value of an indicator such as MACD, as in MACDCurrent = GetIndicatorValue(IndMACD, 0, 2); MACDPrevious = GetIndicatorValue(IndMACD, 1, 2); Is that reading the MACD value from the previ...
by amberwine
Mon Jul 15, 2013 12:01 am
Forum: FT API
Topic: Indicator return value
Replies: 19
Views: 31624

I'm currently using it by looking for the MACD value crossing the origin. So, what I mean by a crossing-point is when the MACD value changes sign, from negative to positive or from positive to negative. There are other ways to use this indicator, e.g. using the signal line, but I'm not currently usi...
by amberwine
Sun Jul 14, 2013 3:13 pm
Forum: FT API
Topic: Indicator return value
Replies: 19
Views: 31624

Here is more of my code, as requested: EXPORT void __stdcall ResetStrategy() { OrderHandle = -1; //ignoreTicks = MIN_TICKS; //ignoreTicks = 8; ignoreIntervals = 30; lastProfit = 0; nextExpectedIntervalTime = 0; MACDCurrent = 0; MACDSignal = 0; MACDPrevious = 0; MACDPreviousSignal = 0; M...
by amberwine
Sun Jul 14, 2013 1:56 pm
Forum: FT API
Topic: Indicator return value
Replies: 19
Views: 31624

I also have a problem relating to the return value from GetIndicatorValue(). I've created a MACD indicator for a strategy I'm working on, with the following call in ResetStrategy: IndMACD = CreateIndicator(Currency, PERIOD_M15, "MACD", "5;13;3;Close"); In GetSingleTick() ...
by amberwine
Sun Jul 14, 2013 8:29 am
Forum: FT API
Topic: How to work with time
Replies: 6
Views: 33351

I think I've worked out how to do this now, thanks. I'm calling TimeCurrent() in GetSingleTick(), then using this value to work out the next expected time of interest based on the selected time-frame. So I ignore all the ticks apart from the ones that come through approx every 15 minutes, if the tim...
by amberwine
Sat Jul 13, 2013 3:37 pm
Forum: FT API
Topic: How to work with time
Replies: 6
Views: 33351

Is there a way to select only those values for indicators like MACD as well as Ask(), Bid prices, etc, in each invocation of GetSingleTick() which correspond to the times shown on the graph for the timeframe set in the FT GUI? I'm developing a MACD strategy, which works, but there are what appear to...
by amberwine
Sat Jul 13, 2013 12:28 pm
Forum: FT API
Topic: Perform code on stop-loss or take-profit event
Replies: 2
Views: 6836

Thanks for the suggestion. After some experimentation I found that the following (C++) also seems to work for capturing the profit (or rather loss) from the last automatically closed trade, due to stop loss. This was all I needed: double lastProfit = 0; if (OrdersTotal() == 0) {...
by amberwine
Sat Jul 13, 2013 6:06 am
Forum: FT API
Topic: Perform code on stop-loss or take-profit event
Replies: 2
Views: 6836

Perform code on stop-loss or take-profit event

When a buy or sell order is created with SendInstantOrder (or SendPendingOrder), is there a way to detect when the order has closed due to hitting its stop-loss or take-profit level? I need to change some internal variables when the order has hit its stop-loss, to set up for the next order, so some ...
by amberwine
Fri Jul 12, 2013 11:44 am
Forum: Programming lessons
Topic: Lesson 3 - Working with orders
Replies: 10
Views: 40921

Actually I managed to work it out after a bit more experimentation and I now have it working. However, thanks for your help.

Useful product, by the way. Well designed and works nicely.
by amberwine
Fri Jul 12, 2013 4:03 am
Forum: Programming lessons
Topic: Lesson 3 - Working with orders
Replies: 10
Views: 40921

This thread looks quite old, but in case anyone is still interested, I've almost got the C++ version to work. However, the call to HourOf() is not available in C++. To overcome this, I created a method-stub, to allow the dll to build, thus: int HourOf(TDateTime dateTime) { return 0; ...

Go to advanced search