Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem Using Save As

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

    Problem Using Save As

    Build 23. Went to save a stratgey using Save As. Starting strategy was named PMA. Save as name was PMAFirstBarColorChange. This is the code from the strategy I started with - look at the bolded for emphasis names that were changed:

    protectedoverridevoid OnBarUpdate()
    {
    if (ToTime(Time[0]) >= 94500 && ToTime(Time[0]) <= 154500)
    {
    if (Position.MarketPosition == MarketPosition.Flat && PMA_PB(true,colorFalling,colorNeutral,colorRising).PMA_PBValue[0] == 1 && PMA_PB(true,colorFalling,colorNeutral,colorRising).PMA_PBValue[1] != 1)
    {
    EnterLong(t1contracts,
    "t1");
    }

    ------------------------------------------------
    See what NT did to the references to my indicators in OnBarUpdate. Save As code shown below.

    protectedoverridevoid OnBarUpdate()
    {
    if (ToTime(Time[0]) >= 94500 && ToTime(Time[0]) <= 154500)
    {
    if (Position.MarketPosition == MarketPosition.Flat && PMAFirstBarColorChange_PB(true,colorFalling,colorNeutral,colorRising).PMAFirstBarColorChange_PBValue[0] == 1 && PMAFirstBarColorChange_PB(true,colorFalling,colorNeutral,colorRising).PMAFirstBarColorChange_PBValue[1] != 1)
    {
    EnterLong(t1contracts, "t1");
    }

    #2
    Hello,


    I believe what the save as simply does is a find and replace for the previous strategy name and replace it with the new strategy name. Therefor since you named your variables to include the name the strategy this was also changed. This therefor is expected as this is how the save as feature works. I will check with development to make sure the is expected however just to double check.

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    82 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    43 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    56 views
    0 likes
    Last Post CarlTrading  
    Working...
    X