I am sure it is my poor explanation!
You can see in the picture i have a serious of AUDCHF trades open as sells, they are going against me. I opened that 0.02 lot buy to hedge that drawn down. The AUDCHF buy closed on its own (as did a similar trade on GBPCAD and what was interesting is both those closed trades were at net 0 together).
I would want all AUDCHF trades to close at BE if the trades ever get to that point!
Request: Close At Breakeven - Specific Pair
-
longytravel
- Trader
- Posts: 27
- Joined: Sun Dec 16, 2012 1:51 pm
Request: Close At Breakeven - Specific Pair
You do not have the required permissions to view the files attached to this post.
-
longytravel
- Trader
- Posts: 27
- Joined: Sun Dec 16, 2012 1:51 pm
Request: Close At Breakeven - Specific Pair
You can see both the GBP and AUD trades closed at breakeven (together). I still had other trades open on those pairs.
You do not have the required permissions to view the files attached to this post.
- milanese
- TechAdmin
- Posts: 3293
- Joined: Wed Jan 09, 2013 9:02 am
- Location: btr rdx, r8 +
Request: Close At Breakeven - Specific Pair
so set the EA only at AUDCHF and make sure that this trades have all the same magicnumber and set this magicnumber as magicnumber for the EA than it will exactly do what you want..longytravel » Wed Mar 26, 2014 7:14 pm wrote:I am sure it is my poor explanation!
You can see in the picture i have a serious of AUDCHF trades open as sells, they are going against me. I opened that 0.02 lot buy to hedge that drawn down. The AUDCHF buy closed on its own (as did a similar trade on GBPCAD and what was interesting is both those closed trades were at net 0 together).
I would want all AUDCHF trades to close at BE if the trades ever get to that point!
Cheers
Tommaso
Global Prime is the official SHF broker 
Searching for Servers and Workstations with individual configuration?
Just PM
Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Searching for Servers and Workstations with individual configuration?
Just PM
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
-
longytravel
- Trader
- Posts: 27
- Joined: Sun Dec 16, 2012 1:51 pm
Request: Close At Breakeven - Specific Pair
That makes sense and i should know better. Thank you for your patience. Last question i promise and i will leave you concentrate on more important matters!
I want to be able to have this going a few charts for if i am running hedges on different pairs. I also use a basic script to drop the trades as i use limit orders.
I have attached the set that i think would work.......effectively i have just set the magic number to '0' for each element where magic number is asked for within the code. I would have the next pair as '1' and so on. Just means i can drop without having to change in the details in the input boxes!?
I want to be able to have this going a few charts for if i am running hedges on different pairs. I also use a basic script to drop the trades as i use limit orders.
I have attached the set that i think would work.......effectively i have just set the magic number to '0' for each element where magic number is asked for within the code. I would have the next pair as '1' and so on. Just means i can drop without having to change in the details in the input boxes!?
You do not have the required permissions to view the files attached to this post.
- milanese
- TechAdmin
- Posts: 3293
- Joined: Wed Jan 09, 2013 9:02 am
- Location: btr rdx, r8 +
Request: Close At Breakeven - Specific Pair
It should do it, if you just change hardcoded thelongytravel » Wed Mar 26, 2014 7:38 pm wrote:That makes sense and i should know better. Thank you for your patience. Last question i promise and i will leave you concentrate on more important matters!
I want to be able to have this going a few charts for if i am running hedges on different pairs. I also use a basic script to drop the trades as i use limit orders.
I have attached the set that i think would work.......effectively i have just set the magic number to '0' for each element where magic number is asked for within the code. I would have the next pair as '1' and so on. Just means i can drop without having to change in the details in the input boxes!?
extern int MagicNumber=0; to the value you want than recompile ..Cheers
Tommaso
Global Prime is the official SHF broker 
Searching for Servers and Workstations with individual configuration?
Just PM
Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Searching for Servers and Workstations with individual configuration?
Just PM
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
- mobthehop
- Trader
- Posts: 362
- Joined: Wed Nov 16, 2011 12:16 am
Request: Close At Breakeven - Specific Pair
Love it! Thanks to original requester and T for coding it....
T, could you do me a personal favour and code a version that:
- multi pairs - ie only need to be run off one chart
1. closes all orders of any ONE currency pair if the profit percentage has reached x% of balance
2. close all open / pending orders of ALL pairs when profit has reached y% of balance (similar to a basket trader) or
3. close all open / pending orders of ALL pairs when profit has reached # of open pairs multiplied by z% of balance or
eg:
1. EUR/USD, balance of account is 5000, profit target 1% (same for each pair!) - close all open orders (including any pending orders) of EUR/USD when total profit of all open orders for EUD/USD has reached 50....
2. Close all orders across the board if overall profit has reached 3% (y%)of balance
or
3. I have orders open for AU and EJ, profit per pair 0.5% (z%) close everything if 1% of balance is reached
Would very much appreciate your help as I am looking for a "helper" like this for ages....
My apologies to the thread owner for posting this here... / Thks in advance MOP
T, could you do me a personal favour and code a version that:
- multi pairs - ie only need to be run off one chart
1. closes all orders of any ONE currency pair if the profit percentage has reached x% of balance
2. close all open / pending orders of ALL pairs when profit has reached y% of balance (similar to a basket trader) or
3. close all open / pending orders of ALL pairs when profit has reached # of open pairs multiplied by z% of balance or
eg:
1. EUR/USD, balance of account is 5000, profit target 1% (same for each pair!) - close all open orders (including any pending orders) of EUR/USD when total profit of all open orders for EUD/USD has reached 50....
2. Close all orders across the board if overall profit has reached 3% (y%)of balance
or
3. I have orders open for AU and EJ, profit per pair 0.5% (z%) close everything if 1% of balance is reached
Would very much appreciate your help as I am looking for a "helper" like this for ages....
My apologies to the thread owner for posting this here... / Thks in advance MOP
- milanese
- TechAdmin
- Posts: 3293
- Joined: Wed Jan 09, 2013 9:02 am
- Location: btr rdx, r8 +
Request: Close At Breakeven - Specific Pair
I will later take a look, what I can do..mobthehop » Thu Mar 27, 2014 10:26 am wrote:Love it! Thanks to original requester and T for coding it....
T, could you do me a personal favour and code a version that:
- multi pairs - ie only need to be run off one chart
- closes all orders of any ONE currency pair if the profit percentage has reached x% of balance
eg EUR/USD, balance of account is 5000, profit target 1% (same for each pair!) - close all open orders (including any pending orders) of EUR/USD when total profit of all open orders for EUD/USD has reached 50....
Would very much appreciate your help as I am looking for a "helper" like this for ages....
My apologies to the thread owner for posting this here... / Thks in advance MOP
Cheers
Tommaso
Global Prime is the official SHF broker 
Searching for Servers and Workstations with individual configuration?
Just PM
Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Searching for Servers and Workstations with individual configuration?
Just PM
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
- mobthehop
- Trader
- Posts: 362
- Joined: Wed Nov 16, 2011 12:16 am
Request: Close At Breakeven - Specific Pair
T,
appreciated....
Please note that I updated my post, just when you posted your reply... Sorry / Mop
appreciated....
Please note that I updated my post, just when you posted your reply... Sorry / Mop
- milanese
- TechAdmin
- Posts: 3293
- Joined: Wed Jan 09, 2013 9:02 am
- Location: btr rdx, r8 +
Request: Close At Breakeven - Specific Pair
I did it code and open a new topic for this http://www.stevehopwoodforex.com/phpBB3 ... 798#p88798mobthehop » Thu Mar 27, 2014 10:40 am wrote:T,
appreciated....
Please note that I updated my post, just when you posted your reply... Sorry / Mop
Cheers
Tommaso
Global Prime is the official SHF broker 
Searching for Servers and Workstations with individual configuration?
Just PM
Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Searching for Servers and Workstations with individual configuration?
Just PM
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
-
longytravel
- Trader
- Posts: 27
- Joined: Sun Dec 16, 2012 1:51 pm
Request: Close At Breakeven - Specific Pair
Dont worry about it Mop, its Tommaso we owe and apology too as i see he has been doing more good work for you!
I have started setting up my scripts so that they have individual Magic Numbers, bad news is that the scripts now dont drop the actual order. I get the dialogue box asking if buy or sell but when selected it doesnt drop the order?!
Any ideas anyone!?
I have started setting up my scripts so that they have individual Magic Numbers, bad news is that the scripts now dont drop the actual order. I get the dialogue box asking if buy or sell but when selected it doesnt drop the order?!
Any ideas anyone!?
You do not have the required permissions to view the files attached to this post.