hello all!
Thanks in advance for all the help.
I have this code in my signal (for a forex algo):
SetStopContract ;
SetPercentTrailing( X, Y) ;
X is the profit per contract, while Y is the trailing %.
Everything works fine, however i just noticed that during live trading, my position is closed consistently a few pips away from what my backtest indicates.
I speculate that it all drills down to SetPercentTrailing trading at market to exit this profitable trade, but since i'm aiming to make quick profits only, those few pips would eat up half of my expected gains alredy.
Is there any function or way I could recreate exactly what SetPercentTrailing does but making sure the exit trade is at a limit price to ensure my live trades trading prices match with the backtests?
I can't find a way to code my own SetPercentTrailing as the algo has many entry trades, i don't know how to track each trade independently.
Many thanks!
Closing a position with SetPercentTrailing but at a limit price
Re: Closing a position with SetPercentTrailing but at a limit price
alternatively, can anyone help with an idea on how to track each entry trade, its P&L and also how to input a close order at limit price for a particular entry trade please? thanks!
the multiple entry trades are from the same entry signal (entry condition).
the multiple entry trades are from the same entry signal (entry condition).
- Polly MultiCharts
- Posts: 206
- Joined: 20 Jul 2022
- Has thanked: 1 time
- Been thanked: 56 times
Re: Closing a position with SetPercentTrailing but at a limit price
Hello kinginhk,
In auto trading if the specified percentage of the maximum profit is lost after the profit has reached the specified value, SetPercentTrailing generates the Stop Order depending on whether the position is Long or Short. Stop Orders might lead to slippage you’ve mentioned.
Unfortunately, there is no option to set Stop Limit Order instead of Stop Order in auto trading.
But you could post your idea at our Project Management and if it is popular among our users, our developers will review the possibility of adding it.
In auto trading if the specified percentage of the maximum profit is lost after the profit has reached the specified value, SetPercentTrailing generates the Stop Order depending on whether the position is Long or Short. Stop Orders might lead to slippage you’ve mentioned.
Unfortunately, there is no option to set Stop Limit Order instead of Stop Order in auto trading.
But you could post your idea at our Project Management and if it is popular among our users, our developers will review the possibility of adding it.