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.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by junkone, Today, 11:37 AM
    2 responses
    12 views
    0 likes
    Last Post junkone
    by junkone
     
    Started by frankthearm, Yesterday, 09:08 AM
    12 responses
    43 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by quantismo, 04-17-2024, 05:13 PM
    5 responses
    35 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by proptrade13, Today, 11:06 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    35 views
    0 likes
    Last Post love2code2trade  
    Working...
    X