Automated Trading Issue

Questions about MultiCharts .NET and user contributed studies.
Posts: 8
Joined: 03 Dec 2018

Automated Trading Issue

Postby lordsriram » 06 May 2019


I am using Portfolio trader for a strategy:
Orders were executed for a % trailing stop using GeneratePercentTrailing statement correctly and the position was closed. I exited out of portfolio trader and had to restart my machine, once i restarted Portfolio trader, the position history is still open and it shows as if the trade never executed. This is very odd. I have turned on Bar Magnifier by the minute, but it still doesn't show the closed position. I tried the same strategy in chart window with bar magnifier and got the same result. The order was correctly created and executed and I am using 4hr charts

Attached is the word document with the execution detail at the broker and the strategy. Please review and help

trailing.png (576.33 KiB) Viewed 116 times
Screenshot_1.png (188.85 KiB) Viewed 114 times
Screenshot_2.png (184.66 KiB) Viewed 114 times
Screenshot_3.png (29.77 KiB) Viewed 114 times

User avatar
Svetlana MultiCharts
Posts: 172
Joined: 19 Oct 2017
Has thanked: 1 time
Been thanked: 43 times

Re: Automated Trading Issue

Postby Svetlana MultiCharts » 09 May 2019

Hello, lordsriram,

The signal performed different calculations during auto trading on real time data and after the restart on historical data. The orders are generated in accordance with the logic of a signal script in both cases. MultiCharts doesn't log user's signal calculation. Please compare the conditions of order generation to find out why the strategy decided to place an order (or not to place) in a particular case.
You can add traces in your code to clearly see the values that the script operates with.
A general example is available in our wiki: ... Commentary
In this article you can find just the examples. Only the script writer knows which values shall be traced in the code to analyze its operation.

Return to “MultiCharts .NET”