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

Bars required to trade in live

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

    Bars required to trade in live

    We have been running our script in Sim and getting ready to g live with and I have few questions.
    The script only has 1 condition : EMA (6 period) crossing above or below SMA ( 14 period) to initiate a long trade or a short trade , using ranger bar : 45 ticks

    What would be the ideal set ups in the strategy for the followings.
    a ) Bar required to trade. We want trade initiated once condition has been met and no need to look at historical data.
    b ) Start behavior
    c ) Order fill resolution
    d) On trailing stop in the scrip I want my stop loss to move to Break even when the trade has moved to 15 ticks in my favor, then trail by 5 tick for each 5 tick in my favor from there on, how do I set that in my Strategy builder > Trailing stop
    e) Can I combine trailing stop & fix stop loss & profit target in my Strategy builder> profit & stop loss.

    Considering that on Calculate " On each tick " has been selected.

    Thank you for your reply.
    Adiano

    #2
    Hello Adiano,

    If historical data is not important, you can set BarsRequiredToTrade to 1 and add a condition to OnBarUpdate to not evaluate when State is Historical.

    if (State == State.Historical)
    return;

    If the script is never going to make historical orders, then it will always start flat and the Start behavior no longer matters.

    Below is a link to a video that demonstrates start up behavior.


    And a public link to the help guide.


    Order fill resolution is only used for historical orders. This can be off.

    If you don't want tick for tick trailing and you want custom logic for trailing, you would need to use exit orders instead of set methods and control the movements with logic.

    Below is a link to an example.


    SetTrailStop cannot be used when SetStopLoss is used. The SetStopLoss will superseded the SetTrailStop and trailing will not function.
    Last edited by NinjaTrader_ChelseaB; 07-09-2018, 03:52 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by TradeForge, 04-19-2024, 02:09 AM
    2 responses
    28 views
    0 likes
    Last Post TradeForge  
    Started by aprilfool, 12-03-2022, 03:01 PM
    3 responses
    327 views
    0 likes
    Last Post NinjaTrader_Adrian  
    Started by giulyko00, Today, 12:03 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by f.saeidi, Today, 12:14 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by AnnBarnes, Today, 12:17 PM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Working...
    X