Function to Assign Entry/Exit according to ruless

Optuma Forums Optuma Scripting Function to Assign Entry/Exit according to ruless

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #54453
    Lester
    • Topics: 25
    • Replies: 42
    • Posts: 67

    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.

    #54465
    Lester
    • Topics: 25
    • Replies: 42
    • Posts: 67

    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

     

    #54477
    Steve
    • Topics: 15
    • Replies: 20
    • Posts: 35

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

     

    Thanks

     

    #54481
    Matthew
    • Topics: 5
    • Replies: 608
    • Posts: 613

    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.

    #54487
    Lester
    • Topics: 25
    • Replies: 42
    • Posts: 67

    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

    #54491
    Lester
    • Topics: 25
    • Replies: 42
    • Posts: 67

    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

     

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest