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 setting (true / false) ???

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

    stopLoss setting (true / false) ???

    Hello,
    I can not understand how the setting of stopLoss using the method (true / false). The code I created a region for order management, where should I move the stop to breakeven when price rises to Be1 (BreakEaven), then again I have to move to the Be1 + value, when the price rises to Be2.
    For example:
    code
    #region OrderRouting
    private void ManagerOrder ()

    if (Position.MarketPosition == MarketPosition.Long )
    SetStopLoss(CalculationMode.Percent,0.02);//Initial Stop

    if( Be1 && High[0] > (Position.AvgPrice + 2 ))
    SetStopLoss("LongFibo°", CalculationMode.Price,Position.AvgPrice,true);//Stop moved to breakeven

    if( Be2 && High [0] > (Position.AvgPrice+5))
    SetStopLoss("LongFibonacci°", CalculationMode.Price,Position.AvgPrice+ 2);// Stop moved to AvgPrice+2

    The stop in this way are activated when the condition occurs, then the next candle, if the condition is no more, the stop is not active. How do I?
    Thanks.
    Roberto
    Please respond by speaking simply because my English is not very good

    #2
    Roberto, this bool determines if the stop is simulated or not - if you use it simulated, that means it's only send when triggered in realtime, an effective way to 'hide' it from the market. In backtesting it would not make a difference which one you use.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Sorry Bertrand,
      I did not understand your answer. Can you give me an example, please.
      Thanks.
      Hello
      Roberto

      Comment


        #4
        Roberto, if the stop is not set to simulated > it would rest in the market / at your broker.

        If it's set to simulated, it would not rest in the market but local on your PC and be sent once triggered by price.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          so if I do:
          SetStopLoss("LongFibo°", CalculationMode.Price,Position.AvgPrice,true)//rest in my PC.

          SetStopLoss("LongFibo°", CalculationMode.Price,Position.AvgPrice,false)// rest in the market at my Broker.
          it's correct?
          Ciao
          Roberto

          Comment


            #6
            Hello,

            Correct.

            Let me know if I can be of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by nicthe, Today, 09:24 AM
            1 response
            5 views
            0 likes
            Last Post nicthe
            by nicthe
             
            Started by samish18, Today, 10:13 AM
            0 responses
            3 views
            0 likes
            Last Post samish18  
            Started by kenz987, Yesterday, 10:20 AM
            2 responses
            13 views
            0 likes
            Last Post kenz987
            by kenz987
             
            Started by nicthe, 08-23-2023, 07:53 AM
            7 responses
            196 views
            0 likes
            Last Post nicthe
            by nicthe
             
            Started by stalt, 12-28-2015, 01:36 PM
            6 responses
            1,536 views
            0 likes
            Last Post giulyko00  
            Working...
            X