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

Which Rule Do I Break "Managed approach"

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

    Which Rule Do I Break "Managed approach"

    Hello to you,

    I’m obviously breaking a rule using the managed approach

    I’m not really good at reading “log file” thought I’m working hard on it

    My initialise() section says

    CalculateOnBarClose = true;
    AddRenko("$EURJPY",5,MarketDataType.Last);
    EntryHandling = EntryHandling.AllEntries;


    SetStopLoss (CalculationMode.Ticks, Stop);

    Meeting certain conditions My Strategy wants to send two orders (sometimes one order only and that works perfect)
    TimeInForce is GTC


    Let’s suppose we go long
    A EnterLong() with a SetStopLoss() and a SetProfitTarget() tagged “Order1”
    And in the same set of instruction

    A EnterLongStop() tagged “Order2” let’s say X(value) above the entry price of the previous EnterLong() average filled price.

    Both should Exit at the “Profit Target” of “Order1”

    Here is the code generating the error

    privatevoid GoLong()
    {
    Print(ChartName + " ACHAT EST LANCE"+String.Format("{0:HH:mm:ss}",DateTime.Now)+" "+Price);
    SetProfitTarget ("order1",CalculationMode.Ticks,Target);
    EnterLong(Coef , "order1");



    if(GainToReach > 65)// let’s suppose it is above 65
    And now I Hit the problem

    {

    startPice = Positions[0].AvgPrice + Xparam*TickSize;
    Print("startPice "+startPice);
    orderStopName = "LongOrderStop";
    SetProfitTarget (orderStopName,CalculationMode.Ticks,Yparam);
    EnterLongStop(startPice,orderStopName);

    }

    }
    It compiles nice and beautiful
    Coef , X , Y have a printout in the output windows and are certified “Clean”

    Witch rule do I break

    Thanks in advance

    #2
    Benoit, I've already replied to the same inquiry you sent to our support email - please use either the forums or our email but refrain from using both as it could potentially lead to double team us up to assist.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      My apologies Bertrand. My intention was to send the message to "BIGMIKETRADING". I realised too late that I still was on your forum

      accept my apologies

      Comment


        #4
        Oh ok understand - no worries Benoit.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        5 views
        0 likes
        Last Post Rapine Heihei  
        Started by f.saeidi, Today, 08:01 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 07:51 PM
        0 responses
        6 views
        0 likes
        Last Post Rapine Heihei  
        Started by frslvr, 04-11-2024, 07:26 AM
        5 responses
        98 views
        1 like
        Last Post caryc123  
        Working...
        X