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 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
      7 views
      0 likes
      Last Post Belfortbucks  
      Started by zstheorist, Yesterday, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      151 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Working...
      X