Reply

Order Management Questions

3 replies

JGSmith

Subscriber, bbp_participant, community, 12 replies.

Visit profile

12 years ago #111415

Hello all.

 

I am not new to trading, but I am new to EA Wizard with no coding experience (which is what drew me to EA Wizard).

 

There are several questions that I have in order to properly automate my strategy.

 

With any answers that you give, would it also be possible to direct me to places on the site or any manuals that are available for this program so that I can put as much personal effort into this without needing to always refer to the forums or support? I appreciate all of your help. For simplicity, I will express everything only for Long positions.

 

Stop Loss

I would like to set my stop loss X number of pips below the simple moving average. My assumption is that I am supposed to deal with this in the “Strategy” tab rather than the “Rules” tab. When I click on “Stop Loss / Profit Target” tab within “Strategy” then I do not see an option under “Formula” or any other area where I can put the stop loss to be X pips below the moving average. How would I accomplish this?

 

Entry

This strategy is designed to enter two orders of equal size and it will enter it X pips above the signal candle. (Signal Candle Definition: The candle that meets all of the “If” criteria) It appears that i am able to enter at a Buy Stop but I am not able to find how I set it to enter X pips above the price of the Signal Candle. (I would also like this to be optimizable).

 

Remove Orders

The order is to remain indefinitely, or until the candle closes below the moving average or another indicator. Can you please help me with how to remove the order?

 

Initial Profit Target

The first entry is to exit at market when the Bid price reaches X% of pips of the signal candle. Example, if the signal candle is 100 pips, then the position is supposed to exit when it has reached 50 pips profit (assuming that it is supposed to exit at 50% of the signal candle). I would like this to be optimized as well.

 

There are more questions but I will leave it at that for now.

 

Thank you for your help and if you are able to direct me anywhere so that I can learn these principles on my own, then that would be really great.

 

0

JGSmith

Subscriber, bbp_participant, community, 12 replies.

Visit profile

12 years ago #122210

I would like to make an update to what I have done through continuing to work with the software. This should allow you to know where things are progressing.

 

Stop Loss

I created a Variable called StopLoss. Currently that variable is set to “1”. I assume that means 1 pip and therefore it will make no difference if it is a JPY pair or not.

After creating the variable I then went into the “Then” section of my entry rule and put this equation in the Stop Loss Section:

(SMA(20)[1]-StopLoss

 

Can you confirm that this is correct? The question that comes out of this is, “Will the stop loss be constantly moving?” I do not want it to be moving as the moving average moves when new candles are formed. I question if it will due to the “[1]”. Will this always be changing the stop according to where the moving average is based on the previous candle when new candles form? I do not wish for the stop loss to move like this.

 

Entry

I added a variable titled “Entry” with the value of 1 (again, assuming that this is 1 pip)

In my Entry tab I then put this information in:

 

Price: (High[1] + Entry)

 

Can you confirm that this will place a long trade at 1 pip above my signal candle?

 

Again, I need that this entry price does not change as new candles are formed. Is there anything that I should be doing to insure that this price stays stationary?

 

Initial Profit Target

No new developments

 

thank you, again, for your help

0

JGSmith

Subscriber, bbp_participant, community, 12 replies.

Visit profile

12 years ago #122212

After spending a great deal of time, I have come up with a possible solution for my profit target issue.

 

I created a Variable titled “ProfitTarget” and gave it the value of 0.5 (Double)

 

Under the Profit target of my entry I now have this formula:

((High[1]-Low[1])*ProfitTarget)+High[1]

 

From what I can tell, this should add a profit target for the first order to be closed when it moves up 50% of the signal candle. (see above for example) And it should allow for me to optimize this percentage.

 

Would others agree with this?

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

12 years ago #122232

Hi,

 

Stop Loss

it is almost correct, but when you want to add/deduct some value in pips from SMA, you should use function ConvertToRealPips() that convert number to real pips value.

For example, ConvertToRealPips(20) will return 0.0020 which is a value of 20 pips converted to real price.

 

So your condition would be: 

SMA(20)[1] – ConvertToRealPips(StopLoss)

 

Entry

same here, if you want to add few pips to the candle high, use the ConvertToRealPips() function.

If you use profit target as 50% of signal candle, then you don’t need to use this funciton, so 

((High[1]-Low[1])*ProfitTarget)+High[1]

is correct.

 

Remove Orders

You can cerate another rule (tab) where you’ll check if the trade is still opened using OrderPosition is not Flat and add another conditions that will check your exit rule

and in the action you can close any order using the command Close Position()

 

 

There are samples, tutorials and description of these functions here :

https://strategyquant.com/eawizard/tutorial_introduction

Mark
StrategyQuant architect

0

Viewing 3 replies - 1 through 3 (of 3 total)