Help for close position partially
9件の返信
こんにちは
Please I will apreciate if you may help me.
I want to close a position (long or short) partially when it is on profit when the price is at X% of TargetProfit. For example
If
Is Bar Open is True
AND MARKET POSITION IS LONG
AND Condition (Price, Indicator, etc.) > OpeningPrice+ConvertToRealPIPS((X/100)*TP), then ClosePartially (Order, Quantity)
My EA is making it well sometimes and it closes partially the position as my condition is triggered.
After the position partial closing, the condition is evaluated again as a new bar opened and if it is true, the EA closes the postion partially again for the same partial profit.
So the EA is closing the position partially more times that I was expected for the same TP if the condition is satisfied at each candle.
What I want is to close partially just one time per condition satisfied.
I will appreciate whatever suggestion.
ありがとう。.
0
こんにちは,
- you need to use a “helper” variable. You can call it “partialTPhit” and set it to 0 (zero) by default as well as with opening the initial position using Assign Variable (partialTPhit) = 0.
- include this variable into your partial exit condition (IF partialTPhit = 0 AND “your other conditions”)
- below the condition add this action – Assign Variable (partialTPhit) = 1. This will prevent additional partial profit taking
For a next new trade it will be reset to work properly by the assign action set in step #1
Let me know if you need an example on this
0
トマス262さんへ
Could you be so kind to build an EA as an example? The target is:
Open Position (TargetProfitInPIPS)
Close 50% of the initial position at 50% of TP (just one time)
Close 50% of the current position at 75% of TP (just one time)
ありがとう
I appreciate it.
0
こんにちは,
so you have 2 partial profit taking and 1 fixed profit-target order?
0
トマス262さんへ
Following your suggestion I have been able to get what I want by setting your setp-by-step for each partial close condition.
My EA has 3 partial TP at 25%, 50% & 75% of TP.
Thank you so much for your help
🙂
0
By the way does your strategy perform better when you apply “scale-out” approach using partial targets compared to all-out version? This is an all-time question 🙂
0
I have found that the trades using the full TP take a long time open. It means less number of trades for the strategy and loosing some oportunities that maybe are more profitable. So I am checking what happens if I close partially the position one or more times with a limit for the number of bars since the position was opened.
ご協力ありがとうございます
🙂
0
Is it possible to make an example of this partial closing to understand better what is meant? Thanks a lot! 🙂
エキスパートアドバイザーによる自動取引
https://www.rabenesche.de
また、以下の分野でも活動しています:
https://forums.babypips.com/u/ravenash
0
こんにちは,
it can be easily done using partial close function
0
Thanks Tomas! 🙂
That’s really easy! 😉
エキスパートアドバイザーによる自動取引
https://www.rabenesche.de
また、以下の分野でも活動しています:
https://forums.babypips.com/u/ravenash
0
9件の返信を表示中 - 1 - 9件目 (全9件中)