Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Beginner Advice Needed

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

    #31
    Originally posted by pswarts View Post
    The strategy as discussed above when backtesting , give me frequent Exit on Close orders with (to me ) random distances from the entry orders at times, at other times the orders execute properly ,but I have no ExitLong or any other Exit for that matter in my code at all. Please advise on what the problem may be. Tnx

    On the attached image the 2nd stoploss was at low of last three bars which is correct, the first order with an ExitOnClose makes no sense. I can attach more images if you need to demonstrate
    I believe that ExitOnClose = true; is the default. If you do not have any ExitOnClose statement, then you will be closed at exit.

    Comment


      #32
      How do I set my stoploss to be (x)ticks below the lowest low of last three bars,when I make the changes as shown it does not work
      SetStopLoss(
      "Entry3", CalculationMode.Price, MIN(Low, 3)[0], true);
      changed to
      SetStopLoss("Entry3", CalculationMode.Price, MIN(Low, 3)[0]-20, true);
      I presume it has to do with Price vs Ticks but does not know how to fix it

      Oh think I found it: is this the correct way?:
      SetStopLoss("Entry3", CalculationMode.Price, MIN(Low, 3)[0]-20 * TickSize, true);
      Last edited by pswarts; 12-13-2011, 03:14 AM.

      Comment


        #33
        PSwarts,

        Yes that should do the trick. If you run into further problem please let me know what output you are getting that is not expected so we know where to isolate.

        -Brett

        Comment


          #34
          Now a paid Ninja customer whooohooo, quick question, when I do Market Replay and enter treades even while I stay connected to market replay when I pick the Replay account and the instrument I traded on it does not generate anything, keep showing just 0.00's , no report. Please advise how I can fix this

          Comment


            #35
            Hello,

            What instrument are you trading on and if you switch to the points mode for the account performance report by selected it in the drop down menu to the right of the generate button does it show now?

            If not toggle between the orders tab and the account performance tab to refresh it and try generate again.

            -Brett

            Comment


              #36
              A little off topic here. But how do I write a Stoploss with an if statement. meaning i only want it to trigger or be true "if" a condition is met?
              does it matter where in the code i insert the code for a stoploss

              Comment


                #37
                Hello hifreq,

                You can use SetStopLoss at any time including in an if statement.

                Once the stop loss has been set with SetStopLoss, you will not be able to remove the stop loss, however, you can modify the price at which it is sitting.

                If you are only wanting to exit the trade when particular conditions are true (and not after the conditions were true but no longer are), it may be better to an exit order.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                19 views
                0 likes
                Last Post algospoke  
                Started by ghoul, Today, 06:02 PM
                3 responses
                14 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                45 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                20 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                181 views
                0 likes
                Last Post jeronymite  
                Working...
                X