Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

stoploss-profittarget in script

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

    stoploss-profittarget in script

    Hello,

    I want to ask please how the setstoploss and setprofittarget are correct so that they work oco (stoploss hit and target cancelled, or target hit and stoploss cancelled) same as with a trade from an atm in charttrader?

    Is this correct with having in the code for a condition-set
    SetStopLoss("rS1a", CalculationMode.Ticks, st1s1, false);
    SetProfitTarget("rS1a", CalculationMode.Ticks, t1s1);
    entryOrderS1=EnterShort(4,1, "rS1a");​

    and another condition-set
    SetStopLoss("rS1b", CalculationMode.Ticks, st2s1, false);
    SetProfitTarget("rS1b", CalculationMode.Ticks, t2s1);
    entryOrderS2=EnterShort(4,1, "rS1b");​​

    Does the oco fro stop and target work correctly this way from the "rS1a" and "rS1b" (and the name "entryOrderS1" and "entryOrderS2" is not important?)

    Or do I have to add something so that I can be sure it works 100% ok and same as stoploss and profittarget from charttrader-atm.

    Thank you!
    Tony

    #2
    Hello tonynt,

    The stop/target are OCO with how you have used them, when using the from entry signal string with the name of the entry that will tie them to the entry and also becomes oco.

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by llanqui, Today, 03:53 AM
    0 responses
    5 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    14 views
    0 likes
    Last Post strategist007  
    Working...
    X