Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Simultaneous Trades at "Exit on Close" With Setting "1 Entry Per Direction&q

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Multiple Simultaneous Trades at "Exit on Close" With Setting "1 Entry Per Direction&q

    NOTE TO OTHERS: If you're reading this message for the first time, go to the bottom of this message to read in date order.


    Dierk,

    Thanks for all your help on this.

    As you can see, I've removed email addresses from the messages and posted them for other's benefit.

    Best regards,

    KBJ



    ----- Original Message ----
    From: Dierk Droth
    To: KBJ
    Sent: Friday, April 27, 2007 1:23:45 AM
    Subject: Re: Multiple Simultaneous Trades at "Exit on Close" With Setting "1 Entry Per Direction"


    Hi,

    Because this is a property of the partial class StrategyBase and your other functions likely are not properties or not properties of the class StrategyBase.

    Would you mind posting these support questions at the forum? Likely other guys would appreciate sharing your experiences?

    Thanks

    Dierk Droth

    [align=center][/align]

    Von: KBJ
    Gesendet: Freitag, 27. April 2007 04:33
    Betreff: Re: Multiple Simultaneous Trades at "Exit on Close" With Setting "1 Entry Per Direction"


    Dierk,

    Thanks. I've added that. And I looked it up on MSDN, but I still have a question about this.

    I have 6 other members in UserDefinedMethods.cs and none of them are causing problems - why don't these other methods show up in the "Misc" category of the Backtest parameters?

    Does the problem with this one have to do with it returning a type of "bool"?

    Best regards,

    KBJ



    ----- Original Message ----
    From: Dierk Droth
    Sent: Wednesday, April 25, 2007 1:08:16 AM
    Subject: Re: Multiple Simultaneous Trades at "Exit on Close" With Setting "1 Entry Per Direction"]

    Hi,

    I suggest marking LastBarOnChart like this:

    [Browsable(false)]
    public bool LastBarOnChart // Returns true if processing last bar added to chart.
    {
    get
    {
    if (!CalculateOnBarClose && CurrentBar == Bars.Count - 1)
    return true;
    else if (CalculateOnBarClose && CurrentBar == Bars.Count - 2)
    return true;
    return false;
    }
    }

    Regards

    Dierk Droth



    [align=center][/align] Von: KBJ
    Gesendet: Mittwoch, 25. April 2007 04:26
    Betreff: Re: Multiple Simultaneous Trades at "Exit on Close" With Setting "1 Entry Per Direction"


    Dierk,

    The "LastBarOnChart" that you refer to was some code I found on the forum that I added to UserDefinedMethods.cs, and it is defined as follows:


    namespace NinjaTrader.Strategy
    {
    partial class Strategy
    {
    public bool LastBarOnChart // Returns true if processing last bar added to chart.
    {
    get
    {
    if (!CalculateOnBarClose && CurrentBar == Bars.Count - 1)
    return true;
    else if (CalculateOnBarClose && CurrentBar == Bars.Count - 2)
    return true;
    return false;
    }
    }
    }
    }


    It's not referenced in TestStrategy.cs, however, so I don't understand why it would be
    displayed in the strategy settings.

    To answer your questions, yes its the right strategy, and I'm using 6.0.0.11.

    Best regards,

    KBJ



    ----- Original Message ----
    From: Dierk Droth
    To: KBJ
    Sent: Tuesday, April 24, 2007 3:47:13 AM
    Subject: AW: Multiple Simultaneous Trades at "Exit on Close" With Setting "1 Entry Per Direction"

    HI,

    I will look into it.

    I noticed one oddity: You strategy settings dialog holds a “Misc” category with a property “LastBarOnChart”. Mine does not.

    Are your sure
    -you sent me the right strategy?
    -You are on NT6B11?

    Regards

    Dierk Droth


    [align=center][/align]


    Von:
    KBJ
    Gesendet: Dienstag, 24. April 2007 00:36
    Betreff: Re: Multiple Simultaneous Trades at "Exit on Close" With Setting "1 Entry Per Direction"


    Dierk,

    I've attached the three files you asked for.

    By the way, the NinjaTrader.mdb file seems to be huge. Is this this normal? The zipped file was over 10Mb so my email refused to send it. I've attached a WINRAR format file instead which is almost 25% smaller - I hope you can read this OK.

    Best regards,

    KBJ






    ----- Original Message ----
    From: Dierk Droth
    To: KBJ
    Sent: Monday, April 23, 2007 10:43:48 AM
    Subject:

    Hi,

    As before I would exact steps to reproduce:
    strategy file
    screenshot of strategy settings
    zipped DB

    Thanks

    Dierk Droth




    From: KBJ
    To: Dierk Droth
    Sent: Monday, April 23, 2007 10:30:26 AM
    Subject: Re: Exit on Close Displays Negative Price - NinjaTrader Support Forum

    Dierk,

    I found another problem that is perhaps related to Exit on Close.

    My most recent backtest ran against three months worth of data, and I noticed at the end of the run that there were 18 simultaneous "Exit On Closes" performed for various trades that were simulated on just 20-Apr-2007. The only problem with this is that under "Order Handling", I have Entries Per Direction set to 1, Entry Hanlding = UniqueEntries and Exit on close is set to True. With the Strategy parameters set this way, how could there ever be more than 1 simultaneous trade, and therefore how could there be 18 simultaneous "Exit On Closes" operations?

    Is it possible that this was fixed with the other Exit On Close fix that you did?

    When I invoke the Strategy limiting the time frame to just 20-April-2007, the problem doesn't occur. I suspect it may be running out-of-memory. Speaking of which, I don't understand why I should get "out of memory" errors when I just bought a new system with 2GB of Ram, and plenty of disk space for virtual memory. Is there a way to tell .NETthat there's more memory available and to please use it? The system seems to run out of memory on the longer tests -- I think its related to excessive Print statements and use of the Output window.

    Best regards,

    KBJ

    Attached Files

    #2
    imported post

    Thanks for posting.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by GLFX005, Today, 03:23 AM
    0 responses
    1 view
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    11 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    6 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    12 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    2 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Working...
    X