Adding Positions
4 replies
daveM
11 years ago #114388
I would like to add a position if the price has moved a certain number of pips from the last order.
Some questions.
How do I determine the price of the last active order, eg say there are two or three active orders, I would need a new reference point for each one or count from the original order.
Would I need a new rule for each additional order?
Can someone clarify this a bit, please
Thanks
daveM
0
Tomas Matejka
11 years ago #133759
If you only need to get price of last order you can create variable “lastOrderPrice” and set it to the value of:
- bar close if you use market order
- If you use stop/limit order set it stop/limit price
on every entry signal created by your EA.
Otherwise you would have to save and use different magic numbers for each individual order to control them all. This can be quite complicated if you use large amount of orders.
0
daveM
11 years ago #133764
Thanks tomas.
I used the variable and got it to work well.
daveM
0
Rocksolidfx
10 years ago #137563
please explain i’m new to coding.. I just wish to add to a simple moving average example given if condition are true. kindly what is the code for this. Thank you
0
Tomas Matejka
10 years ago #137686
please explain i’m new to coding.. I just wish to add to a simple moving average example given if condition are true. kindly what is the code for this. Thank you
Hello, can you describe in more details what you want it to do? I can do an example then
0
Viewing 4 replies - 1 through 4 (of 4 total)