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 kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    26 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    16 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    136 views
    0 likes
    Last Post SalmaTrader  
    Working...
    X