How to specify specific Entry and Exit

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #61159 quote
    Abz
    Participant
    Veteran

    Hello,

    im trying to write a code that could enter on specific date , month and year and then exit on antother specific date . Below is an example of entry and exit.

    i have 30 – 40 different entry and exit dates i want to backtest on different stocks.

    Entry                          Exit

    05.07.2013                08.10.2013

     

    thanks

    #61160 quote
    robertogozzi
    Moderator
    Master

    Can’t you select the date/time range in the backtest dialog box?

    Hard coding dates in the code would make it more difficult for you to later change them, wouldn’t it?

    #61186 quote
    Abz
    Participant
    Veteran

    I want to test single dates on multiple shares. I thought then if it is possible to specify the date, I do not manually need to adjust the date on each stock

    #61187 quote
    robertogozzi
    Moderator
    Master

    There you go (you will replace dotted lines with your code and set your own conditions), but I still think using a watchlist next to the backtest dialog box would do way better:

    ONCE StartDate = 20130705
    ONCE EndDate   = 20131008
    TradingON      = (date >= StartDate) AND (date <= EndDate)
    .
    .
    IF Your_Conditions AND TradingON THEN
       BUY/SELLSHORT......
    ENDIF
    .
    .
    Abz thanked this post
    #61191 quote
    Abz
    Participant
    Veteran

    exactly what i needed. thanks robertogozzi

    #193615 quote
    Wolf
    Participant
    New

    Hi guys,

    Can you please help me, I would like to be able to enter trades manually and then simply have a code or system that will close automatically for me all trades at a specific time, for example end of the day, or a certain time..

     

    Please let me know I can’t find a way to do this with deals opened manually..

     

    Thanks

    Ivan

    #193616 quote
    robertogozzi
    Moderator
    Master

    It’s not possible for any automatic strategy to know about trades opened manually or by other strategies.

    You can only manually close trades opened by any automatic strategy, but that strategy will be immediately stopped.

    #193641 quote
    PeterSt
    Participant
    Master

    You can only manually close trades opened by any automatic strategy, but that strategy will be immediately stopped.

    Ehh …
    You can only stop automatic strategies, and depending on parameter settings the position will immediately be closed, or left open for you to deal with manually.

    #193642 quote
    Wolf
    Participant
    New

    Hi Roberto, I am Italian like you but I write in English so everyone can read us too..

     

    I formally requested Prorealtime to add the possibility to “close all trades” at a specific time or date and time even for the deals opened manually.

    The reason behind my request is that I am finding hard to close the losing deals and I let them run for days and days until they become a big loss, eating all my profits.

    At the end this is a rule very commonly used by day traders ” to close all positions when trading session closes” to prevent indeed having any open deal becoming a big loss overnight or due to gapping at next open..

    I know we have Stop losses, but I prefer to trade with no stop loss and then just close all deals at the end of the day… I just can’t do it I suppose due to emotional trading (it’s hard to manually close losing deals!) So I would be happy to have this option in the system that does it automatically for me, for all my deals..

    PeterSt thanked this post
    #193644 quote
    robertogozzi
    Moderator
    Master

    I understand. Only PRT can be of help by adding an option to close a trade at a given time, in any case or only if losing at that time. I hope they adhere to your request sometime in the next months/years.

    #193662 quote
    Wolf
    Participant
    New

    Hi Roberto,

    I hope too because looking at my day trading stats, if I would have “all my losing deals” closed at the end of each day for example I would be consistently in profit and this is because my % win rate is quite higher than the losers.

    I just have to stick to the rule to cut the losers short and for this I need a system to do it for me 🙂

     

    I will update you if they let me know.

    Thanks

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

How to specify specific Entry and Exit


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Abz @abbas_sadiq Participant
Summary

This topic contains 10 replies,
has 4 voices, and was last updated by Wolf
3 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/01/2018
Status: Active
Attachments: No files
Logo Logo
Loading...