Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

delta ratio

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

    delta ratio

    Hello, I am trying to convert this indicator from tradestation to ninja.
    Two questions I have are as follows, the rest of the code I think I will I get program it.
    1 as was desiganan to variables in the code are as intrabar persist.
    This type of variables will be updating with bar without closing.
    2. the second is that function returns insideask and insidebid, which are the best price at which are the bid and the ask and tradestation are snapshot.
    Thank you




    inputs:
    Period(20),
    UpColor(green),
    DownColor(red);

    variables:
    MyVol(0),
    Color(yellow),
    SmoothedBA(0),
    Length(squareroot(Period)),
    intrabarpersist MyCurrentBar(0),
    intrabarpersist VolumeAtBid(0),
    intrabarpersist VolumeAtAsk(0),
    intrabarpersist BAVolRatio(0),
    intrabarpersist VolTmp(0);

    if LastBarOnChart then begin
    MyVol = Iff(BarType < 2, Ticks, Volume);
    if CurrentBar > MyCurrentBar then begin
    VolumeAtBid = 0;
    VolumeAtAsk = 0;
    BAVolRatio = 0;
    VolTmp = 0;
    MyCurrentBar = CurrentBar;
    end;
    if InsideBid < InsideAsk then begin
    if Close <= InsideBid then
    VolumeAtBid = VolumeAtBid + MyVol - VolTmp
    else if Close >= InsideAsk then
    VolumeAtAsk = VolumeAtAsk + MyVol - VolTmp ;
    end;

    #2
    Hello,

    Welcome to the NinjaTrader support forums:

    It is difficult for me to understand you, howevere I think I understand what your looking for.

    1) This depends on how you run the code. When you start a strategy you choose if you want it to be Calculate on Bar Close = True or Calculate On Bar Close = False.

    2) You would want to use the following function:





    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Hello, thanks for your response.
      The second part already is clear, also I have found an indicator which already brings the ninja named buysellpressure that is like.
      As regards the first question I understand what I said but I have a doubt.
      Do as I do so variables work on Bar Close = True and other Bar Close on = False?
      If said me some code example I study and ask you if I have any questions.

      Trying to programming this indicator has arisen me another question, in order to use the math class I have to enable it somehow?
      I try to use it, but it gives me error, does not exist in the current context.

      Sorry my bad English.

      Comment


        #4
        If you would like to combine both CalculateOnBarClose settings in one code, please study this sample here - http://www.ninjatrader.com/support/f...ad.php?t=19387

        The Math class should be available if you're using the System namespace in your script (which would be the case per default).

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        581 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        338 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X