Jump to content
Medved Trader Forums

Mike Medved

Administrators
  • Posts

    1,537
  • Joined

  • Last visited

  • Days Won

    123

Everything posted by Mike Medved

  1. This is very weird. I can't get this to repeat. If/when happens again, please send us your settings including data (export everything, including data, then use WeTransfer to send it to us) and send us the screenshot of what is happening. Also tell us what brokerage you're using to place the order (although really shouldn't matter).
  2. The Last, High, Low, Close come from the "Chart" - that is, current chart. Not from current-chart-up-to-the-candle-being-processed... Prev Close, Prev Open etc. also come from the chart but they obviously don't change as new data gets added. If you wanted to use High/Low for current timestamp, you'd keep track of it yourself. It is easy enough, you just have to define the DayHigh/DayLow and DayNum outside the function, zero it out when the DayNum is not equal to TradingDay.DayNumber, adjust the DayHigh and DayLow to the new candle's high and low, and set the DayNum to TradingDay.DayNumber. .fctbNone{ color:#000000; } .fctbStyle5{ color:#0000ff; } .fctbStyle7{ color:#000000; }double DayHigh = 0; double DayLow = 0; int DayNum = -1; public void MainCalculation() { if (DayNum != TradingDay.DayNumber) { DayNum = TradingDay.DayNumber; DayHigh = High; DayLow = Low; } DayHigh = Math.Max(DayHigh, High); DayLow = Math.Max(DayLow, Low); } If you want to restrict it to only regular session, you'd have to also condition it on other TradingDay. properties. Like TradingDay.IsPreMarket or something.
  3. Um no For that, you can just use the Close of the current candle being considered no?
  4. Yeah I really don't see anything weird in that code. When you apply it now it works as it should?
  5. IB's data is not the greatest. They absolutely refuse to expose the same L2 data you get in TWS in the API. And the API itself is the stuff of nightmares. But you work with what you have.
  6. Ok when I try running MT with IB as the source, for GME it shows Prev Close column as 43.03 Not sure how yours shows 39. Do this: open Intraday GME chart.. Clear data using the ribbon menu. Then look at your portfolio - is Prev Close still 39?
  7. Looking at the chart, 43 is the previous close. Not sure where IB TWS gets 39 from. Not sure also how you get 39 in the chart. Basically - if checked, it calculates the value from the data whereas when unchecked it takes it from the feed's Previous Close value for the last day. Can you take a look at your raw data - is there some spike 39 value right before 16:00 there? (When I do this here with my data I don't get the 39 to show up).
  8. Well that depends on what the frequency of the candle is (that is, 2 hours with 1 min candles would be 120 candles, but with 5 min candles obviously would be 24). Looping functions going back 100 would work but not be efficient. It could be done by using a state counter - each time Last<VWAP would increase the counter, and each time Last>=VWAP it would zero out the counter. When the counter reaches 120 (for 1-min candles).. bingo. Or of course instead of the counter you could use the timestamp of the candle and compare the diff. between now-candle and the first candle where Last<VWAP. That would work with non-time-based candles, but would create a problem when the two-hour period crosses the session boundary, though.
  9. Email to support which indicator and I can explain the algorithm.
  10. LOL. Ok I hate to demonstrate my stupidity, but when you change a variable name in the Vars section, the editor would go through and change that variable name everywhere in the hotkey. Unfortunately, one restriction was omitted, so when you changed the variable name from OrderType to OrderType1, it changed the OrderType TAG (not variable) in the Command section to OrderType1 as well.
  11. To follow up - is my writeup in the help file too terse or insufficient? Would adding examples like the above help? If so, what examples?
  12. will add wordier but more clear one in next post. BTW while doing this I found that bug you had 3acor with OrderType1 etc. Will fix.
  13. If you tell me what you'd like to do, I will make one and post it.
  14. It is very weird. I am not sure how that is possible... I would suggest removing that action and redoing it. If it happens again, please tell me how
  15. Ctrl-V, ctrl-C, ctrl-X are special windows keys...
  16. 3acor - how in the world did you get OrderType1 into the order itself? Were you editing JSON yourself? Can you go to your list of hotkeys, right click on it, export and send it to me?
  17. Well Shift-Z is just a capital Z.. MT reserves all letters so you can type things in input boxes. Try ctrl-z? ctrl-shift-Z?
  18. Mike Medved

    hotkey to buy

    Hm. Was the trade account selected on the trading window the hamilbody one? Is this repeatable (obviously change the Send to false so you dont send stuff out when testing)?
×
×
  • Create New...