Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position Close and Opening next position on the same bar

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

    Position Close and Opening next position on the same bar

    Hello, I would like to ask about the following question:

    Let's assume I have 1000L exposition in EURUSD. I would like to gain exposition of 1000S: that is "close" position of 1000L and open 1000S. How to do it the quickest way? Especially, I would like not to wait for a new bar to come in order to open 1000s after closing 1000L.

    If there is any related topic in help, maybe you could suggest where to look for it.

    Thanks in advance,
    Mike

    #2
    Thanks for the post Mike.

    The Enter() methods would reverse automatically for you - from the timing perspective it would depend on which events you're issueing the orders. With OnBarUpdate() and CalculateOnBarClose set to 'true' it would be processed ear bar only, however you could set CalculateOnBarClose to false and then you could process events on each tick in realtime / market replay.

    If you wish to work for example on the exact fill report / event of an order, then you would need to look into issueing those commands from OnExecution() - this method would be called for each incoming execution and would not be tied to the bars update timing.

    A reference sample for working those more advanced concepts could be reviewed here - http://www.ninjatrader.com/support/f...ead.php?t=7499

    Content rich NinjaScript help generally is directly available in the software, just press F1 and review the NinjaScript / Language Reference section.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    20 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    119 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X