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 Mindset, 04-21-2026, 06:46 AM
0 responses
101 views
0 likes
Last Post Mindset
by Mindset
 
Started by M4ndoo, 04-20-2026, 05:21 PM
0 responses
144 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by M4ndoo, 04-19-2026, 05:54 PM
0 responses
71 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by cmoran13, 04-16-2026, 01:02 PM
0 responses
125 views
0 likes
Last Post cmoran13  
Started by PaulMohn, 04-10-2026, 11:11 AM
0 responses
79 views
0 likes
Last Post PaulMohn  
Working...
X