Function to Assign Entry/Exit according to ruless

Hi Forum,

Currently when Back Testing with “trade price” set to ‘signal’, the buy and sell prices are set at the OPEN price of the day!

Is there a way to allocate exact buy and sell prices according to the rules of entry/exit?

For example if the price happens to exceed the weekly HIGH() of last week by $0.01, then the entry should be at that exact price. Same thing should happen on exit.

Cheers, Lester

ps I am using the End of Day (EOD) version of Optuma.

Hi Forum,

I should have added that the PRICEATSIGNAL() could be used to get the price (or if that does not work use the VALUEWHEN() function).

But how do I set it equal to the actual Entry & Exit Price??

Cheers, Lester

 

Yes - I too would like to backtest with more options in terms of entry/exit prices, rather than next bar open, for example.

 

Thanks

 

Hi,

With the back tester, the Entry / Exit can be set to the price at a specific signal, but only when certain type of indicators (those that are plotted directly onto the chart, like a Moving Average, Bollinger Bands, etc) are used in the script.

When scripts using these types of indicators are setup, the entry or exit price will be placed at the indicators price (where possible).

Here is an example using a simple Close crossing above / below a 50EMA script:

Enter at Signal

Ex1

You can see the entry arrow is at the MA value, not the open or close.

Enter next day Open

Ex3

If there’s a gap up / down and the bar crosses the indicator line in one go, the Open price is used.

Scripts that don’t use chart based plot values, such as VOL() IsUp, can’t be set to enter / exit at the signal price.

Hi Matthew,

Thanks for the comment, however I was looking to use more than the indicators you mentioned.

I have added a feature request for future builds of Optuma, so if any members wish to add their support please do so the New Feature Forum.

Cheers, Lester

Hi Forum,

I am using a very rough work around for this issue. Selecting “Signal Day Close” will allocate the close price of the day. So if your entry/exit rules trigger they will be probably be under the CLOSE(), (not in all cases though). I am guessing if your system works with your system, then it could work OK in real market conditions.

Cheers & Good Trading, Lester