Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem: Stop Loss is set - but not from my script

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

    Problem: Stop Loss is set - but not from my script

    Hi all!

    I have a strategy that does not set any stoploss. But when I start the strategy the lines below appear in the output windows.
    The interesting thing is, that I have no stoploss set in this strategy.
    Additionally the line "Fresh from DB: stoploss_distance_p: 0.005" is a print (debug) command from a completely different strategy of mine.

    How can this happen?
    Is there a solution?

    Best regards,
    Stefan

    Edit: I just noticed the lines below appear already in the output window when I OPEN the strategy dialog box to add a new strategy to a chart. I have no strategy selected by this time.

    8/15/2011 10:35:52 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='longposition' Mode=Ticks Value=200 Currency=0 Simulated=False
    8/15/2011 10:35:52 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='longposition' Mode=Percent Value=0.005 Currency=0 Simulated=False
    Fresh from DB: stoploss_distance_p: 0.005
    8/15/2011 10:35:52 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='longposition' Mode=Percent Value=0.02 Currency=0 Simulated=False
    8/15/2011 10:35:52 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='longposition' Mode=Percent Value=0.02 Currency=0 Simulated=False
    Fresh from DB: stoploss_distance_p: 0.005
    8/15/2011 10:35:52 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='longposition' Mode=Percent Value=0.02 Currency=0 Simulated=False
    8/15/2011 10:35:52 AM Entered internal SetStopTarget() method: Type=Target FromEntrySignal='shortposition' Mode=Percent Value=0.02 Currency=0 Simulated=False
    **NT** Enabling NinjaScript strategy 'breakingchannel20110813/95f3973948864aa6be66b674acd7a9ba' : On starting a real-time strategy - StrategySync=SubmitImmediately SyncAccountPosition=False EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10000 CancelEntryOrdersOnDisable=False CancelExitOrdersOnDisable=False MaxRestarts=50 in 500 minutes
    Last edited by caliph; 08-15-2011, 02:57 AM.

    #2
    caliph, generally the Initialize() method is called across all scripts present - the print debug command from another strategy would mean it's somewhere running as well, could it for example in another workspace that would be currently non visible? You could toggle through open ones via Shift + F3.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for the fast answer.

      I closed all other workspaces and the situation remains the same.
      Additionally no Initialize method has such a print command in any of my strategies.

      I just noticed the lines above appear already in the output window when I OPEN the strategy dialog box to add a new strategy to a chart. I have no strategy selected or started by this time.

      Comment


        #4
        Correct, at the point where you open the 'strategies select' window to add a script the Initialize() is alreadu called, where normally the Set() commands for the stops are resting.

        If you like to clear the output window up before using the strategy, I would suggest a ClearOutputWindow() call in OnStartUp().

        For the Print command : where would that be called in the strategy code?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I tried and localized the problem to be functions of the same name with declaration "public void". I renamed them and now the startegy works as intended.

          Regarding the Print commend: I have to take back my earlier statement. It was indeed located in a function that was called in the Initialize method.

          Thanks for the explanations; they helped a lot.

          Comment


            #6
            Thanks for letting me know, happy to hear you could trace it down.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Renorail, Today, 01:38 PM
            2 responses
            8 views
            0 likes
            Last Post bltdavid  
            Started by BrianARice, Today, 01:16 PM
            0 responses
            5 views
            0 likes
            Last Post BrianARice  
            Started by Ousher, Today, 09:08 AM
            0 responses
            6 views
            0 likes
            Last Post Ousher
            by Ousher
             
            Started by Unsuitable, Today, 08:41 AM
            0 responses
            14 views
            0 likes
            Last Post Unsuitable  
            Started by newdill, Today, 07:54 AM
            0 responses
            8 views
            0 likes
            Last Post newdill
            by newdill
             
            Working...
            X