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

Trailing Stop

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

    Trailing Stop

    hello guys,

    I am having a theoretical question. Somewhere in the help tutorial I read that the trailingStop can be either defined in the Initialize or in OnBarUpdate procedure. What is the difference between these two? Can you provide some source code or example where the difference would be visible? I also read that when using in OnBarUpdate it has to be reseted after every entry - what does it mean?

    Another question is, is there any possibility to set the orders so as when the price move one point in your favour, this profit would be locked (but the position would not be closed). Then, when the price will continue to go in your favour, the trailing stop would be set from this one point profit. If the price goes against you, the posisiton would be closed and profit of one point would be made.

    Thanks a lof for your answers.
    Stepan

    #2
    Hello Stephan,

    We have the following sample for help dynamically setting a stop loss value, including resetting to an initial value. This sample uses SetStopLoss()


    Regarding your second block of questions - This is essentially how SetTrailStop() works. It trails the market by the specified tick or percent, but it won't retreat if the market starts heading towards it.
    Last edited by NinjaTrader_RyanM1; 05-31-2011, 08:44 AM.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Started by alifarahani, Today, 09:40 AM
    6 responses
    40 views
    0 likes
    Last Post alifarahani  
    Started by Waxavi, Today, 02:10 AM
    1 response
    18 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by Kaledus, Today, 01:29 PM
    5 responses
    15 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Working...
    X