Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compiling question

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

    Compiling question

    Good morning,
    i am trying to compile a very simple automated strategy, but all the times doesnt work.

    I want to do the next thing:

    when the time arrives to 11:33:56
    put an entry EnterLongStop of thats time (14:19:55) price + 20 tics

    TrailingStop 20 tics and move every 5 tics

    Can someone give me any advise?

    Thank you

    I compiled this....but doesn´t work:

    {
    // Condition set 1
    if (ToTime(Time) >= ToTime(11, 33, 56) && ToTime(Time) <= ToTime(11, 33, 57))
    {
    EnterLongStop(Ordenes, GetCurrentAsk() + 20 * TickSize, "Largos 20");
    }
    }

    #2
    Hi Ikerbar,

    Thank you for posting and welcome to the forums!

    So, I can better assist you, can you please answer the questions below.

    What is the time interval you are using for the chart?

    What instrument will this strategy be run on?

    What is the Calculate On Bar Close set to? True or False?

    You can use the TraceOrders = true;
    When enabled this will generate a confirmation in the output window on the call of each order method and provide information if order methods are ignored and why.

    See the link below on using Trace Orders.
    http://www.ninjatrader.com/support/h...raceorders.htm
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Good morning Hal,

      im using candles of 1 min

      calculateonbarclose = false

      Im using it for GC

      Thank you

      Comment


        #4
        Hi Ikerbar,

        Thank you for the clarification.

        From your code your order will be placed, however on the next bar update it will get cancelled since the next the bar will be created three seconds after the condition is met based on your 1 min chart.

        I would recommend using the Live Until Cancelled feature of the EnterLongStop().

        Code:
        EnterLongStop(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double stopPrice, string signalName)
        Please be aware that the Live Until Cancelled is a more advance way of coding and uses the Advanced Order Handling. You will also need to tell it when to cancel the order if it does not get filled.
        Click here for more info on the Advanced Order Handling

        Please let me know if I can be of further assistance.
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Spiderbird, Today, 12:15 PM
        2 responses
        10 views
        0 likes
        Last Post Spiderbird  
        Started by WHICKED, Today, 12:45 PM
        0 responses
        3 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by FrazMann, Today, 11:21 AM
        2 responses
        6 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by rjbtrade1, 11-30-2023, 04:38 PM
        2 responses
        80 views
        0 likes
        Last Post DavidHP
        by DavidHP
         
        Started by lorem, Yesterday, 09:18 AM
        5 responses
        18 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X