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

Streak and Stop Loss

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

    Streak and Stop Loss

    Good Morning,

    I'm trying to break losing streak in my strategy.

    I'm using the strategy builder as my programming knowledge are not good enough to do it.

    I would like your help with the following:

    1) I would like to add a condition using a variable that is 0 if the previous trade was a winner and 1 is it was a loser. If the Streak Variable = 0 it places an order, if Streak Variable = 1 it does not place an order but if It would do it the trade end as a winner and it makes the Streak Variable = 0 and it will be taken the next trade.
    I'm struggling to get it to work. I need the condition to make the variable 0 or 1, also I need this variable to change to 0 even when it does not take the trade.
    Can you please tell me how to do it?

    2) Also, I'm trying to set a stop loss that is a % of my current account value. For example, Stop loss = 3% of Account Value.

    Thank you in advance for all your help.
    Regards
    Carlos

    #2
    Hello Carlos,

    Thanks for your post.

    I do not think that you can accomplish your first objective within the strategy builder but would suggest that this would involve at best an elaborate use of bool variables to control the sequencing. They key objective of "if Streak Variable = 1 it does not place an order but if It would do it the trade end as a winner and it makes the Streak Variable = 0" would likely be the stumbling block as you would have to guess at the entry/exit and/or perform math on variables which is not available in the strategy builder.

    For #2, you would not be able to set this automatically in the strategy builder as the account value is not available.

    Please note that we do not provide programming services. We can leave this thread open for others in the community that may wish to provide this level of assistance.

    Alternatively, you may want to hire a 3rd party programmer who would be able to create a strategy to meet your needs (although not in strategy builder form). If this is of interest we can provide a link to a developers site in the Ninjatrader ecosystem.

    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mokaru Zen, Today, 01:20 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by dgee949, Yesterday, 06:26 PM
    1 response
    35 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by dgee949, Yesterday, 05:58 PM
    1 response
    39 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by papaoutai, Yesterday, 08:56 AM
    1 response
    41 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by grzltn, Today, 02:18 AM
    0 responses
    19 views
    0 likes
    Last Post grzltn
    by grzltn
     
    Working...
    X