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 Haiasi, 04-25-2024, 06:53 PM
        4 responses
        61 views
        0 likes
        Last Post effraenk  
        Started by ccbiasi, 11-23-2017, 06:06 AM
        5 responses
        2,200 views
        0 likes
        Last Post leodavis  
        Started by kujista, Yesterday, 12:39 AM
        2 responses
        14 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by Austiner87, Yesterday, 11:24 AM
        2 responses
        13 views
        0 likes
        Last Post brucerobinson  
        Started by Rogers101, 05-05-2024, 11:30 AM
        3 responses
        22 views
        0 likes
        Last Post Rogers101  
        Working...
        X