Login Page - Create Account

Support Board


Date/Time: Sat, 20 Apr 2024 13:58:53 +0000



Post From: Position Data Structure Members

[2014-03-03 18:15:08]
User82615 - Posts: 106
Hello I want to program a trading system that calculates the open profit/loss of my actual open position to exit when it has at a close of a bar a profit or 8 points and the close of the bar is lower that the open of the bar.

For example I tried with : PositionData.OpenProfitLoss > 8 && sc.GetBarHasClosedStatus () == BHCS_BAR_HAS_CLOSED && sc.BaseDataIn [SC_LAST] [sc.Index] < sc.BaseDataIn[OPEN][sc.Index] to exit my position but the system doesn't calculates the OpenProfitLoss > 8 , it exits my position as soon as the close of the bar is lower that the open.

Am I doing anything wrong?

Thank you for your help