How to stop a started Auto trade?
Forums › ProRealTime English forum › ProOrder support › How to stop a started Auto trade?
- This topic has 18 replies, 6 voices, and was last updated 7 years ago by GraHal.
-
-
01/22/2017 at 11:55 AM #2200701/22/2017 at 12:57 PM #2201701/22/2017 at 1:12 PM #2201801/22/2017 at 1:22 PM #2202101/23/2017 at 12:12 AM #22075
Hi Nuf
Might you share what you found / how to do it please … then we will know?
@Eric … how do you get multiple Demo Accounts with IG or do you mean only multiple Live Accounts? I opened a second account but it was a Live Account.Thanks
GraHal01/23/2017 at 8:57 AM #2208301/23/2017 at 9:40 AM #22091Ah right good … that will Quit the Algo if your equity drops > 200 (as example 2 in your link) from your starting equity, so 10k start – 200 if equity drops to £9.8K.
Your original post stated stop the auto trade if an amount of money is lost during the day … and by that I thought you meant during any day?? This is something I have wanted also! For example, if an extreme condition occurs for which none of my Algos are designed to cope (e.g. outbreak of war) then a drop of x amount quits all Algos by using a Quit condition in each separate Algo, but good for each day. So, for example, Equity 10k start + 5k profit but drops by 1k to 14k then Algo Quits. Quit in your ‘example 2 link’ will not do that because the Algo is still 4k in profit overall.
Amyway if you / anybody manages to get a ‘Quit for the day’ coded up please share with us.
Thanks
GraHal01/23/2017 at 10:15 AM #22104Hi.
Maybe I got it wrong. I interpreted the code for quitting the auto trade. In the opening it say:
“Instruction used to stop a trading system. All opened, stop and limit orders are close when the instruction is used.
Stopped strategy with the QUIT instruction cannot be re-launched automatically by code. Only a manual intervention can do it.”
I am new to this, so I am not sure.
01/23/2017 at 10:57 AM #22116Nufstad is right about the QUIT instruction, it does exactly what it is described in the documentation.
If you want to “quit for the day”, then the usual code snippet from the blog should do the trick : https://www.prorealcode.com/blog/learning/max-profit-loss-day-trading-strategy/1 user thanked author for this post.
01/23/2017 at 1:30 PM #2212901/25/2017 at 9:08 AM #22388Hello! When I use the same code with the exact same setting my code uses different strategis in either Backtest or Auto trading. The program does not trade the same in the different programs with the same time settings.
CODE
Used for Germany 30 Cash (1euro mini)
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated// Conditions to enter long positions
indicator1 = RSI[10](close)
indicator2 = RSI[12](close)
c1 = (indicator1 >= indicator2)IF c1 THEN
BUY 3 CONTRACT AT MARKET
ENDIF// Conditions to exit long positions
indicator3 = Stochastic[10,6](open)
indicator4 = Stochastic[20,6](open)
c2 = (indicator3 <= indicator4)IF c2 THEN
SELL AT MARKET
ENDIF// Stops and targets
SET STOP pTRAILING 1IF StrategyProfit<-200 then
QUIT
ENDIFAnyone with the experience to solve my problem?
01/25/2017 at 11:26 AM #22405Hi Gurra
I assume you are asking about QUIT? If Yes, I would expect your code
IF StrategyProfit<-200 then
QUIT
ENDIF
to Quit the Algo if your starting equity drops > 200, so 10k start – 200 … Algo stops if equity drops to £9.8K. As it says in the documentation … Stop the strategy if the actual profit is losing 200 of the money account.
Cheers
GraHal01/25/2017 at 11:31 AM #22406If you are not asking about QUIT then your code is probably executing different in Backtest versus Demo Forward Test due to subtle differences betwen Backtest and Demo Forward Test and we all experience these subtle differences.
Also you have SET STOP pTRAILING 1 … I doubt this will work on any instrument as 1 point is far too low to be acceptable (to yuor broker) and iny case you would be stopped out far too often and so your Algo is not robust. Try SET STOP pTRAILING 5 (or 10 etc)
Let us know how you get on please.
Cheers
GraHal01/25/2017 at 12:10 PM #22414Hello Gurra,
>> Please update your country flag in your profile. Thank you 🙂 <<
>> For clarity of messages on ProRealCode’s forums, please use the “insert PRT code” button to separate the text of the code part! Thank you! <<
01/25/2017 at 12:37 PM #22415Hi Noobs
Something is not right re the ‘Insert PRT Code’ button … see attached, there is no button and hasn’t been for me for 7 to 10 days now (well maybe intermittently / off and on??).
I’m on Windows 10, my browser is Firefox 50.1.0.
GraHal
-
AuthorPosts
Find exclusive trading pro-tools on