Announcement

Collapse
No announcement yet.

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.

    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]));

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        84 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        46 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        66 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        69 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        58 views
        0 likes
        Last Post CarlTrading  
        Working...
        X