Strat working on B/T but failing on A/T with FXCM

Questions about MultiCharts and user contributed studies.
User avatar
ym58
Posts: 10
Joined: 17 Jan 2011
Has thanked: 2 times

Strat working on B/T but failing on A/T with FXCM

Postby ym58 » 25 Jan 2012

I have a strategy that works quite right on backtesting but fails to work when A/T with FXCM.

The strat synopsis is quite simple :

step1 : open X contracts with a stoploss at, say, -10pips below EntryPrice and a partial exit of X/2 contracts at, say, +20pips above EntryPrice

Then, as soon as the partial exit has been reached and executed :

step2: place a new s/l at break-even (EntryPrice) and a final exit (of the remainder X/2 contracts) at, say, +30pips above EntryPrice

My code works PERFECTLY on backtesting, but does not work quite right on A/T with FXCM.

Step1 works alright, FXCM takes all the orders well, shows them in the TradingStation while MultiCharts shows them right on the chart and both exit and stoploss work great.

But then, when it comes to step2, after the partial exit has been reached : the position is left opened at FXCM with X/2 contracts (that is normal) but the new stoploss (the one at break-even) as well as the new profit (the one at +30pips) are NO LONGER accepted nor rejected (!) by FXCM and my remaining position (X/2) remains opened until I have to close it manually !

Here's the piece of code that I use (LONG entry only in this example) :

Code: Select all

[intrabarOrderGeneration=true] ;
// Opening
// *******
if MP=0 and Long_SetUp=true then Buy ("LongEntry") OpenContracts contracts next bar at targetprice stop;
// Profit Exits
// ************
if MP>0 and CurrentContracts=OpenContracts then Sell ("ProfitExit1") OpenContracts/2 contracts next bar at (Entryprice+20pips) limit;
if MP>0 and CurrentContracts<>OpenContracts then Sell ("ProfitExit2") all contracts next bar at (Entryprice+30pips) limit;
// StopLoss Exits
// **************
if MP>0 and CurrentContracts=OpenContracts then Sell ("LossExit") all contracts next bar at (Entryprice-10pips) stop;
if MP>0 and CurrentContracts<>OpenContracts then Sell ("BEExit") all contracts next bar at (Entryprice) stop;
Last edited by ym58 on 26 Jan 2012, edited 1 time in total.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Strat working on B/T but failing on A/T with FXCM

Postby Henry MultiСharts » 26 Jan 2012

Hello Yann,

This issue will be fixed in the next version of MultiCharts.
Thank you for reporting.

User avatar
ym58
Posts: 10
Joined: 17 Jan 2011
Has thanked: 2 times

Strat working on B/T but failing on A/T >>> OCO issue ?

Postby ym58 » 26 Jan 2012

Thanks for the info, Henry.

Until this bug is fixed in the next version of MC, I am posting here a request to other members.

Does anyone see any workaround to this typical OCO problem ?

Once again, the code that DOES work when Backtesting and that DOES NOT work in AutoTrading is :

Code: Select all

[intrabarOrderGeneration=true] ;
// Opening
// *******
if MP=0 and Long_SetUp=true then Buy ("LongEntry") OpenContracts contracts next bar at targetprice stop;
// Profit Exits
// ************
if MP>0 and CurrentContracts=OpenContracts then Sell ("ProfitExit1") OpenContracts/2 contracts next bar at (Entryprice+20pips) limit;
if MP>0 and CurrentContracts<>OpenContracts then Sell ("ProfitExit2") all contracts next bar at (Entryprice+30pips) limit;
// StopLoss Exits
// **************
if MP>0 and CurrentContracts=OpenContracts then Sell ("LossExit") all contracts next bar at (Entryprice-10pips) stop;
if MP>0 and CurrentContracts<>OpenContracts then Sell ("BEExit") all contracts next bar at (Entryprice) stop;
One may PM me to get the full strat code.
Thanks.

StratMan
Posts: 173
Joined: 13 Dec 2009
Has thanked: 22 times
Been thanked: 13 times

Re: Strat working on B/T but failing on A/T with FXCM

Postby StratMan » 27 Jan 2012

I don't see any workaround to your problem as I am not writing scripts myself, but what I can say is that I duly witnessed very similar problems when I was trying to use the Master Strategy on my FXCM real account.
At the time I experienced these problems, I had already reported it to the TSS team.
I hope that this issue will now be shortly solved as TSS is a registered Service Provider with FXCM !

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Strat working on B/T but failing on A/T with FXCM

Postby Henry MultiСharts » 01 Feb 2012

The fix for this issue will be released in MultiCharts 8.0 Beta 1

User avatar
ym58
Posts: 10
Joined: 17 Jan 2011
Has thanked: 2 times

Re: Strat working on B/T but failing on A/T with FXCM

Postby ym58 » 01 Feb 2012

What is the most probable ETA for this release, Henry ?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Strat working on B/T but failing on A/T with FXCM

Postby Henry MultiСharts » 02 Feb 2012

Hello Yann,

MultiCharts 8.0 Beta 1 is expected in two weeks.
We are going to release both version: 32bei and 64 bit.

User avatar
ym58
Posts: 10
Joined: 17 Jan 2011
Has thanked: 2 times

Re: Strat working on B/T but failing on A/T with FXCM

Postby ym58 » 02 Feb 2012

Henry,
That's good news ... thanks for the info.
As usual, TSS fellows move on swiftly and make giant leaps forward !
---
One question, though : will the MC-64bit version be 100% compatible with 32-bit DLL's (I've read some posts stating that ADE and/or GV may not be compatible) ?
Another (more personal) question : will FXorder2Go.exe be working 'as is' with the MC-64bit version or will we have to wait for another API from FXCM ?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Strat working on B/T but failing on A/T with FXCM

Postby Henry MultiСharts » 03 Feb 2012

Henry,
That's good news ... thanks for the info.
As usual, TSS fellows move on swiftly and make giant leaps forward !
---
One question, though : will the MC-64bit version be 100% compatible with 32-bit DLL's (I've read some posts stating that ADE and/or GV may not be compatible) ?
Another (more personal) question : will FXorder2Go.exe be working 'as is' with the MC-64bit version or will we have to wait for another API from FXCM ?
Please refer to this thread for more details viewtopic.php?f=1&t=9674#p46140
FXorder2Go.exe should be working 'as is' with the MultiCharts 64bit

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Strat working on B/T but failing on A/T with FXCM

Postby Henry MultiСharts » 07 Feb 2012

64 bit version of ELCollections.dll can be found at this page
The 64 bit version of globalvariable.dll is a part of MultiCharts 64 bit. It is included in the installer by default.

User avatar
ym58
Posts: 10
Joined: 17 Jan 2011
Has thanked: 2 times

Re: Strat working on B/T but failing on A/T with FXCM

Postby ym58 » 08 Feb 2012

Thanks for the link + info, Henry.


Return to “MultiCharts”