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

assigning variable value??

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

    assigning variable value??

    SetProfitTarget("", CalculationMode.Price, Variable0);

    Variable0 =Position.AvgPrice+.0050;

    its not calculating the operation i assigned it just taking the value .0050 and excuting..

    i need to get the EnterLong price then adding 0.0050 to the Long price and assign the sum to Variable0

    pls hlp

    #2
    Deall, I would then not use .Price mode here, but .Ticks - then just enter your target value in ticks and you should be good. That would be the easiest way to realize this setup.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      how to round of the tick size corresponding to the price value using this < Instrument.MasterInstrument.Round2TickSize(double price); > syntax and how to define it in the script

      Comment


        #4
        In which context do you seek to apply it? You would just pass in your double value you would like to see rounded 2 ticksize.

        So for example to plot a rounded SMA value you could do -

        Plot0.Set(Instrument.MasterInstrument.Round2TickSi ze(SMA(20)[0]));
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cre8able, Yesterday, 01:16 PM
        3 responses
        11 views
        0 likes
        Last Post cre8able  
        Started by ChartTourist, Today, 08:22 AM
        0 responses
        6 views
        0 likes
        Last Post ChartTourist  
        Started by LiamTwine, Today, 08:10 AM
        0 responses
        2 views
        0 likes
        Last Post LiamTwine  
        Started by Balage0922, Today, 07:38 AM
        0 responses
        5 views
        0 likes
        Last Post Balage0922  
        Started by JoMoon2024, Today, 06:56 AM
        0 responses
        6 views
        0 likes
        Last Post JoMoon2024  
        Working...
        X