Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

instrument pairs, PSar stop

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

    instrument pairs, PSar stop

    Hi,
    1. what code do i need to define instrument pairs?
    (I.e. if retail leads SPY, enter long.....)

    2. I wanted to use a Parabolic Sar Trail Stop, but this might not the way to build it:
    SetTrailStop("",CalculationMode.Ticks,(ParabolicSA R(0.02, 0.2, 0.02)[0]);

    #2
    Hello,

    Thanks for the forum post.

    This unfortunately would require multi series programming to bring in the secondary data point which would be the other instrument. How to do this is detailed here.



    On your secont question you wouldnt use SetTrailStop() you would instead use SetStopLoss() then set it to CalculationMode.Price and add in the indicator output as the price. Then you will want to use this sample code to constantly update it and move the stop up when the SAR tightens.



    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      How would i do that to set indicator output as price?

      I did that so far but get error message "overload"
      SetStopLoss("",CalculationMode.Price, (ParabolicSAR(0.02, 0.2, 0.02)[0]));

      Comment


        #4
        You have too many parameters for this overload of SetStopLoss().

        Try this instead:

        SetStopLoss(CalculationMode.Price, (ParabolicSAR(0.02, 0.2, 0.02)[0]));
        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        68 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        38 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 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