Jump to content
Medved Trader Forums

ahujat

Members
  • Posts

    171
  • Joined

  • Last visited

Posts posted by ahujat

  1. What I meant to ask was that there is a one-day delay before I get the correct data. If I start the application today, it won't have the data for yesterday, and then get the correct data the next day. Let's say MT is restarted the next day or the system crashes, I don't MT will retain the highs/lows from today, and then there will be a day delay. Moreover, even if MT retains the data over restarts, if MT is restarted after five days, the Prev11amLow/high will be wrong because it will be 5 days old. No?

     

    Basically, what I want is that if I start MT  today, I want yesterday's data to be available today or if I restart after 5 days, the Prev11amLow/High should be 4 days from now. Any way to do that taking into account partial days and holidays?

  2. On 8/28/2021 at 11:07 AM, Mike Medved said:

    As to your question how to do the high/low not AT 11am but since 11am - it is a fairly small change in the paintbar code..

    
    
    		


     

    Hi Mike

    Will this work across system reboot and MT restart or even system crash/hang (where I have to forcibly reboot the system without closing MT)?

    I also need something like this, high/low for a particular time range from the previous trading session.

  3. I have two scanners running in a single scanner code, on intraday data.

    On one of the scans, scanner condition might happen multiple times, and the scanner sets and clears the scanner column in the portfolio based on when the condition is met and then maybe on the second bar the condition is unmet and then it clears the scan column.

    On the second scan, if the condition is met once, the alert remains visible through the day.

    As an example, my scan looks for the bar closing below Previous day's low (Just an example but the real scan is a more than that)

    1. In the first scan, it should set the scan column but when if the next or later bar closes above Previous day's low, it should unset the scan column.

    2. In the second scan, whenever a bar close below the previous day's low, it should set the scan column but even if the next or later bar closes above the previous day's low, scan column should still be set. Basically, in this case, the scanner code has to remember the scan condition is met and then ignore further movements. 

    I am able to do the first scan but can't figure out the second one. Is there an example for that? Or some simple code that I can incorporate into my scanner code? 

  4. Something is seriously wrong. So, I had 4 lots of 1000*multiplier open. On the chart I put in a limit order to close the position. It instead shorted 4 5000*multiplier lots. I got lucky that I caught it in time, otherwise could have been a disaster.

    In TWS, if I put in a limit order on either of the two contracts, it shows up on the same chart symbol.

  5. I am seeing an issue with Partial fills.

    I believe when a partial fill happens, The Trade_LastFillQty returns the number of shares in that particular order and not the partial fill. This happens rarely, so difficult issue to debug. Can you please check if that's the case? 

  6. On 2/17/2023 at 12:00 PM, Mike Medved said:

    Yes. The problem (a bit) is that hotkey is executed once while paintbar is executed potentially 100,000 times within a fraction of a second. Accessing the account data is not fast...

    Will check on it.

    Any Update on this.

     

    Meanwhile, can the P&L calculation be based on Midpoint of Bid/Ask rather than Last?  In Options, in some cases, the difference between last and Midpoint can be quite a bit. Also, I believe IB does the calculations based on Midpoint of Bid/Ask rather than last.

  7. Even Hotkeys default to the Account selected in that window and if you need to change the account, you can specify it explicitly. Same Hotkey can exist in multiple types of windows (Level II, Trade Ticket, etc.) while the Paintbar is tied to a specific chart window, where it's enabled. I guess it can default to the account selected in the that window. No?

×
×
  • Create New...