Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Need integer number of pips

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

    Need integer number of pips

    Hello,

    für my strategy I will need the integer number of pips:

    risk_long = GetCurrentBid() - Swing(SWValue).SwingLow[0];

    risk_long_pip1 = risk_long * 10000;
    risk_long_pip1 = Math.Round(risk_long_pip1);

    GainLong1 = risk_long_pip1;

    #region Variables
    .....
    private double risk_long = 0;
    private double risk_long_pip1 = 0;
    private double gainLong1 = 0;
    .....

    #region LONG Entry and Profit:
    -----
    if ......
    {
    EnterLongStop((int)(PTLongTA1*1000), High[0], "Long1");
    .....
    }

    Where ist the problem?

    Thanks für your support..
    Andrew

    #2
    this is the profit exit:

    if (Position.MarketPosition == MarketPosition.Long
    && GetCurrentBid() >= Position.AvgPrice + GainLong1*TickSize)

    Comment


      #3
      Hello Blackburn,

      Thank you for writing in. To help narrow down the problem, could you please let me know what error message you are getting or what exactly is happening when you run your strategy?

      Thank you in advance.
      Michael M.NinjaTrader Quality Assurance

      Comment


        #4
        Hello Michael,

        for better understanding I´m sending you a picture and the cs-file.

        Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.



        Andrew
        Attached Files

        Comment


          #5
          Hello Blackburn,

          Unfortunately I still do not understand what the issue is. Could you please explain the following:

          1. What exactly you are trying to accomplish

          2. What is happening with the code you are using

          With this information I will be able to provide you with a complete answer.

          Thank you in advance.
          Michael M.NinjaTrader Quality Assurance

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by fx.practic, 10-15-2013, 12:53 AM
          5 responses
          5,403 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by Shai Samuel, 07-02-2022, 02:46 PM
          4 responses
          94 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by DJ888, Yesterday, 10:57 PM
          0 responses
          6 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by MacDad, 02-25-2024, 11:48 PM
          7 responses
          158 views
          0 likes
          Last Post loganjarosz123  
          Started by Belfortbucks, Yesterday, 09:29 PM
          0 responses
          8 views
          0 likes
          Last Post Belfortbucks  
          Working...
          X