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 PeakTry, Today, 10:49 AM
0 responses
2 views
0 likes
Last Post PeakTry
by PeakTry
 
Started by llanqui, Today, 10:32 AM
0 responses
4 views
0 likes
Last Post llanqui
by llanqui
 
Started by StockTrader88, 03-06-2021, 08:58 AM
45 responses
3,992 views
3 likes
Last Post johntraderuser2  
Started by TAJTrades, Today, 09:46 AM
0 responses
8 views
0 likes
Last Post TAJTrades  
Started by rhyminkevin, Yesterday, 04:58 PM
5 responses
62 views
0 likes
Last Post dp8282
by dp8282
 
Working...
X