• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with a order

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

  • NinjaTrader_PatrickH
    replied
    Hello firecan,

    Thank you for your response.

    You need to set EntriesPerDirection to 3 and EntryHandling to AllEntries: http://www.ninjatrader.com/support/h...ryhandling.htm

    Then give unique entrySignalNames and use them for fromEntrySignalName in the SetProfitTarget and SetTrailStop methods:
    Code:
    protected override void Initialize()
    {
        EntriesPerDirection = 3;
        EntryHandling = EntryHandling.AllEntries;
    SetProfitTarget("ole1", CalculationMode.Ticks, 8);
    SetProfitTarget("ole2", CalculationMode.Ticks, 16);
    SetProfitTarget("ole3", CalculationMode.Ticks, 20);
    SetTrailStop("ole3", CalculationMode.Ticks, 20, false);
    
    CalculateOnBarClose = true;
    }
    
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (Close[0] > Close[1])
    {
    EnterLong(MyInput0, "ole1");
    EnterLong(MyInput0, "ole2");
    EnterLong(MyInput0, "ole3");
    }

    Leave a comment:


  • firecan
    replied
    I do not know the answer at your questions.
    Only I have this code.
    I am beginning.
    can you send me any example.
    Regards.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello,

    Are you using the fromSignalName that is the matching signalName used by the entry?

    For example:

    EnterLong(1, "longEntry1");
    SetStopLoss("longEntry1", CalculationMode.Ticks, 20, false)
    SetStopLoss(string fromEntrySignal, CalculationMode mode, double value, bool simulated)
    http://www.ninjatrader.com/support/h...etstoploss.htm

    Also, what is the Entries per direction set to in the strategy parameters?

    Leave a comment:


  • firecan
    replied
    Profit 3

    Hello.
    I cannot introduce this change
    All is ok, but when i introduce Target2 and Target3 they are ingnored.

    I try to enter with 3 contracts.
    The first one with profit to 8 ticks.
    The second one with profit to 16 ticks.
    The third runs with the trailstop.

    Can help me.

    Regards.

    ----------------------------------------------------------------------------------

    #region Variables
    private int myInput0 = 3; //Total contrats
    #endregion
    protected override void Initialize()
    {
    SetProfitTarget("", CalculationMode.Ticks, 8);
    // SetProfitTarget("2", CalculationMode.Ticks, 16);
    // SetProfitTarget("3", CalculationMode.Ticks, 20);

    SetTrailStop("", CalculationMode.Ticks, 20, false);

    CalculateOnBarClose = true;
    }

    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (Close[0] > Close[1])
    {
    EnterLong(MyInput0, "ole");
    }
    Last edited by firecan; 10-31-2014, 02:39 PM.

    Leave a comment:


  • firecan
    replied
    Thanks again.

    ("F4") or ("0.000")

    Regards.

    Leave a comment:


  • koganam
    replied
    Originally posted by firecan View Post
    Thanks again.

    But print 18 digits. 0,00235189521452356

    What can I do to only print 0,002

    Regards.
    Math.Round()?

    ref: http://msdn.microsoft.com/en-us/libr...(v=vs.90).aspx

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hi firecan,

    To format a number of decimal places, use the double.ToString() method with a fixed point format specifier.

    myDouble.ToString("F2")

    http://msdn.microsoft.com/en-us/libr...v=vs.110).aspx

    Leave a comment:


  • firecan
    replied
    Print

    Thanks again.

    But print 18 digits. 0,00235189521452356

    What can I do to only print 0,002

    Regards.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hi firecan,

    Print() will print to the output window. (Tools -> Output Window...)

    If you want to draw text below the bar, use DrawText().

    For example:

    DrawText("myText"+CurrentBar, (EMA(5)[0]-EMA(5)[1]).ToString(), 0, Low[0]-3*TickSize, Color.Blue) ;

    http://www.ninjatrader.com/support/h...7/drawtext.htm

    Leave a comment:


  • firecan
    replied
    Print

    Hello I have tried almost of everything without result
    Can someone to say the correct code to me to print under every bar the difference between EMA(0) and EMA(1).

    Print (EMA(5)[0] - EMA(5)[1])

    Regards.

    Leave a comment:


  • firecan
    replied
    Fantastic

    Fantastic for that we are beginning.

    Best impossible, with code and everything.

    Very grateful.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello firecan,

    If you would like to prevent orders from entering when the current bars time is equal to the previous bars time, write a check for the time in the condition. Use a string so that it compares the second, or minute, or whatever part of the time and date you would like.

    For example:

    Code:
    if (CurrentBar < 2)
    return;
    
    if (Time[0].ToString("M/d/yyyy hh:mm:ss") != Time[1].ToString("M/d/yyyy hh:mm:ss") &&
    		Close[0] > EMA(10)[0])
    {
    	//execute code
    }

    Leave a comment:


  • firecan
    replied
    Renko

    Thanks for your fast reply.

    http://content.screencast.com/users/...c/Picture1.jpg

    2 question:

    The bars 1, 2, 3 and 4 go Long for the condition ok.

    The bar 5 no enter because the condition not ok.

    But the bars 6, 7 and 8 have the same time

    And it happens that 6 and 7 bars does not launch orders but 8 launches three.

    Is posible to have only one launches though 3 bars exist with the same time.

    Regards.

    Leave a comment:


  • koganam
    replied
    Originally posted by firecan View Post
    Hello I have two questions about a renko graph.

    The first one:

    In a moment of high volatility, I can see some bars with the same time.

    Is it possible to change the color of this bars with the same time?

    Up bars = green

    Down bars = red

    Bars with same time = White (Up and Down)

    Regards.
    You would have to write an indicator to do it. The main code would be:
    Code:
    if (Close[0] > Open[0]) BarColor = Color.Green;
    else if (Close[0] < Open[0]) BarColor = Color.Red;
    else  BarColor = Color.White;

    Leave a comment:


  • firecan
    replied
    New question

    Hello I have two questions about a renko graph.

    The first one:

    In a moment of high volatility, I can see some bars with the same time.

    Is it possible to change the color of this bars with the same time?

    Up bars = green

    Down bars = red

    Bars with same time = White (Up and Down)

    Regards.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by henit, 08-24-2019, 09:10 AM
3 responses
40 views
0 likes
Last Post guidoisot  
Started by zoreanuv, Today, 01:14 AM
0 responses
2 views
0 likes
Last Post zoreanuv  
Started by profitabletrader306, Today, 12:00 AM
0 responses
3 views
0 likes
Last Post profitabletrader306  
Started by marcelodelta, Yesterday, 08:28 PM
2 responses
11 views
0 likes
Last Post marcelodelta  
Started by junkone, Yesterday, 09:06 PM
1 response
11 views
0 likes
Last Post NinjaTrader_Marco  
Working...
X