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 burtoninlondon, Today, 12:38 AM
        0 responses
        9 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        14 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        13 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,983 views
        3 likes
        Last Post jhudas88  
        Working...
        X