Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-instrument script problem

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

    Multi-instrument script problem

    I have single instrument scripts I have programmed (not from the wizard, but by hand). They work just as I expect. I then created a multi-instrument script. This works just as I expect, but only for certain trading combinations. I have 3 instruments:
    1) The base instrument - BarsArray[0]
    2) The long instrument - BarsArray[1]
    3) The short instrument - BarsArray[2]

    This configuration works just as expected. The base is used just for signals, the long is for going long, the short for going short. Note that I exit the long and go short at the same bar (and vice/versa).

    Then I wanted to have this configuration:
    1) The base instrument - BarsArray[0]
    2) The long instrument - BarsArray[1]
    3) The 2nd long instrument - BarsArray[2]

    So I used the same code but changed the EnterShort for the BarsArray[2] instrument to an EnterLong. The same for the exit. In that case I never can enter the BarsArray[1] instrument long! I speculate that it is not until the bar actually closes that I get the buy/sell so it thinks there are two positions long at the same time? I believe it is something like this. Any thoughts?

Latest Posts

Collapse

Topics Statistics Last Post
Started by CarlTrading, 03-31-2026, 09:41 PM
1 response
67 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 04-01-2026, 02:41 AM
0 responses
36 views
0 likes
Last Post CarlTrading  
Started by CaptainJack, 03-31-2026, 11:44 PM
0 responses
61 views
1 like
Last Post CaptainJack  
Started by CarlTrading, 03-30-2026, 11:51 AM
0 responses
62 views
0 likes
Last Post CarlTrading  
Started by CarlTrading, 03-30-2026, 11:48 AM
0 responses
53 views
0 likes
Last Post CarlTrading  
Working...
X