Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 12:02:29 +0000



Post From: Simple trailing stop doesn't work for me

[2016-12-08 10:33:55]
User788673 - Posts: 2
I have used sc.SupportReversals both as true and as false. I followed this suggestion to make it work: http://www.sierrachart.com/index.php?page=doc/AutoTradeManagment.php#UnmanagedAutomatedTrading

So basically in the sc.SetDefaults, I have these variables now:

sc.AllowMultipleEntriesInSameDirection = true;
    sc.AllowOppositeEntryWithOpposingPositionOrOrders = true;
    sc.AllowEntryWithWorkingOrders = true;
    sc.MaximumPositionAllowed = 1200;
    sc.SupportReversals = true;
    sc.CancelAllOrdersOnEntriesAndReversals = false;
    sc.AllowOnlyOneTradePerBar = false;



and I make an order exactly like in the first post, one with a trailing stop. Lastly, I use sc.BuyOrder(NewOrder) and sc.SellOrder(NewOrder), but the system still only goes long.

The first messages of the message log are: "SellEntry reversal order processed." The messages after a bit become: "SellEntry reversal ignored. Position with exit working orders quantity:" and a negative number that keeps increasing. -76, -78, etc.


Finally, the last messages of the log are: "Order cancellation failed | The order is no longer working and cannot be canceled"

All these problems then come from any attempt to initiate a short position I think.