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

ATM + NinjaScript Small Problem

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

    ATM + NinjaScript Small Problem

    Hey guys, I've uploaded an ATM + NinjaScript Strategy I'm testing. and it enters Trades Fine. But 2 problems that I just can't fix. The Entry orders are placed before Range Bar Closes, so:

    1. When Bar Closes in one direction I want other Entry to Cancel. it's NOT Cancelling

    2. When two bars close in my favor I want Stop To be Moved, In the (Manage Orders) Section of the Code you'll see.

    But when I run the strat, after Trade Enters the Stop is NOT moved at all.

    please review and tell me where I'm wrong. I just don't get it. Thanks!!
    Attached Files
    Last edited by ginx10k; 09-25-2015, 09:27 AM. Reason: ReUPLOADED File, there was No Cancel Order on last Upload

    #2
    Hello,

    Thank you for the questions.

    For the cancel of the entry, I see you are using the correct method but are not using the variable you created:

    AtmStrategyCancelEntryOrder("atmBUYStrategyId");

    In this case, you have the variable name but it is surrounded by quotes making it a string instead, this may be the error preventing the cancel of the entry as the rest of the script is using the variable instead of a string.


    For the change of stops, I don't see that you are using a valid signal name for the stops.

    You currently have: AtmStrategyChangeStopTarget(0, nextHigh + ( (spread) * TickSize), "SellSTOP", atmSELLStrategyId);

    SellSTOP is not a valid signal name, instead you would need to use the name you see in the control center, so if it was Stop1 you would need to use Stop1 to match the names.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Your a G. Thanks So Much. I was completely Wrong. The Value Not String is what works.
      Last edited by ginx10k; 09-25-2015, 11:38 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by WHICKED, Today, 12:45 PM
      2 responses
      16 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by GussJ, 03-04-2020, 03:11 PM
      15 responses
      3,272 views
      0 likes
      Last Post xiinteractive  
      Started by Tim-c, Today, 02:10 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      2 views
      0 likes
      Last Post Taddypole  
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      51 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Working...
      X