Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bid/Ask Data

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

    Bid/Ask Data

    Hi all,

    I'm backtesting a strategy and I need the bid/ask data plotted on the backtest chart. Right now I have the chart set to chart the bid as bars, which is fine since in this case if I use EnterShort() it is realistic in that it hits the bid. However, I need it to lift the offer (buy at the offer/ask) instead of simply ExitShort() since ExitShort() will just exit, in this case, at the bid, which is not realistic.

    I have tried to add the offer on the chart with this in Initialize() to no avail:

    Add("ES 03-14", PeriodType.Second, 1, MarketDataType.Ask);

    What would be optimal is to have it chart last trade price bars and superimpose the bid/ask lines/bars over this and then submit orders to EnterShort() and ExitShort() at the bid and ask, respectively.

    I am using eSignal as my data provider.

    Thanks
    Last edited by albazzaztariq; 12-28-2013, 04:15 PM.

    #2
    Hi Albazzaztariq,

    Thank you for your post.

    You can use GetCurrentAsk() and GetCurrentBid() to get those prices to test and then enter your orders via the condition.

    http://www.ninjatrader.com/support/h...currentask.htm
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply.

      I already have been using GetCurrentAsk() but I was unsure if that was really executing me at that offer HISTORICALLY. So you're telling me if I say

      if (GetCurrentAsk() < Position.AvgPrice)
      ExitShort();

      This will lift the offer/buy at the ask price that occured at that historical time in the backtesting? The reason I ask is I am/was afraid that it was filling me at last trade price and not the bid/ask since that's not superimposed over the backtest chart

      Comment


        #4
        Wow, I should have read the link beforehand. I see that it's substituting the close price. I'll look some stuff up tomorrow and get back on this thread.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        5 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
        97 views
        1 like
        Last Post caryc123  
        Working...
        X