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 samuelsilvaimi, Today, 07:15 PM
    0 responses
    7 views
    0 likes
    Last Post samuelsilvaimi  
    Started by Genesis2021, Today, 04:58 PM
    0 responses
    11 views
    0 likes
    Last Post Genesis2021  
    Started by relogical, Today, 04:51 PM
    0 responses
    18 views
    0 likes
    Last Post relogical  
    Started by Genesis2021, Today, 04:26 PM
    0 responses
    18 views
    0 likes
    Last Post Genesis2021  
    Started by robertcooney, Today, 03:37 PM
    1 response
    24 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Working...
    X