Automated strategy discrepancy

Questions about MultiCharts and user contributed studies.
CAGMAD
Posts: 15
Joined: 04 May 2016
Been thanked: 1 time

Automated strategy discrepancy

Postby CAGMAD » 17 May 2016

Good morning,

I have a strategy on RB futures (NYMEX) running from Portfolio Trader, sending orders to my IB paper account, and I have the same strategy running from an MC chart (so I can see trigger levels, etc). The settings of the the instrument are the same (in PT and the MC chart) and the data feed is from IB.

I reboot my PC every evening at around 22:00h CET (before the close of RB futures). After the reboot, I open PT and put it on automation but I don't open the MC chart where I have the strategy. I open this chart, every day, the following morning.

Last week, one afternoon, a strategy trade took place from Portfolio Trader but not from the MC chart. The only difference is that I left PT open during the night, and I opened the workspace of the strategy in the MC chart the next morning.

After I was aware of the trade discrepancy, I rebooted my PC again and when I automated the strategy in PT, the trade had disappeared but I was left with a trade in my paper trading account.

Would anybody know why a trade was generated from PT when it shouldn't have been generated?

Kind regards
CAGMAD

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

Re: Automated strategy discrepancy

Postby Henry MultiСharts » 17 May 2016

Hello CAGMAD,

Realtime strategy calculation results can be different from the backtesting results. Backtesting results achieved at one point of time can be different from the results of backtesting run at a different time.

Please study the following articles to get a better understanding of how backtesting and realtime trading are working:
https://www.multicharts.com/trading-sof ... ve_Trading
https://www.multicharts.com/trading-sof ... Calculated
https://www.multicharts.com/trading-sof ... ng_Results
https://www.multicharts.com/trading-sof ... results%3F

I would also recommend you to verify the order generation logic by outputting the variables and conditions involved in order generation. Here is a sample code for that: 
https://www.multicharts.com/trading-sof ... t_Executed

CAGMAD
Posts: 15
Joined: 04 May 2016
Been thanked: 1 time

Re: Automated strategy discrepancy

Postby CAGMAD » 26 May 2016

Thanks Henry.

I have had another issue with an automated strategy that I am running in Asyncronous mode out of an MC chart.
The strategy (instrument: 6BM6) recorded a trade overnight in the chart but the trade wasn't sent to my paper brokerage account. Another strategy (instrument 6NM6) in a different chart, printed in the chart and sent an order correctly.

The automation settings of the two strategies are the same.

These are the log messages:

26/05/2016 1:11:26: IB; Connection to TWS has been stablished
26/05/2016 1:12:20: The Automated Order Execution mode has been turned on
26/05/2016 1:12:31: The Automated Order Execution mode has been turned on
26/05/2016 1:12:55: Market data farm connection is inactive but should be available upon demand.usfuture.us
26/05/2016 5:30:50: Market data farm connection is broken:secdefil

The two trades took place between 1:12:55 and 5:30:50.

Do you know why one trade wasn't sent to my broker but recorded in the chart whilst the other was recorded on the chart and sent correctly? (Broker and data feed are from IB).

Regards
Cagmad

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

Re: Automated strategy discrepancy

Postby Henry MultiСharts » 10 Jun 2016

Do you know why one trade wasn't sent to my broker but recorded in the chart whilst the other was recorded on the chart and sent correctly? (Broker and data feed are from IB).
You need to add output to your code to figure it out:
https://www.multicharts.com/trading-sof ... t_Executed


Return to “MultiCharts”