Jump to content
Medved Trader Forums

Mike Medved

Administrators
  • Posts

    1,538
  • Joined

  • Last visited

  • Days Won

    123

Everything posted by Mike Medved

  1. Define "long-term uptrend (not necessarily monotonic)" algorithmically. Maybe "in the last 30 candles, at least in 20 of them the EMA went up"? Same with "short-term downtrend" for candles? - "In the last 6 candles, at least 5 were up, and the last one was up"? You will find that once you define these things for yourself, writing the scan becomes a lot simpler.
  2. 1. That 'Buy' and 'Sell' variables - put them in Variable section. Makes it easier Not sure about your +33 / -33 third leg but I retained it here. Something like this?
  3. CapOrderType is the order type of the Capsule over which the mouse is hovering. Since there is no capsule, don't use it. I would suggest using instead PriceAtMouse<=Price?'Buy':'Sell' for the main order and PriceAtMouse<=Price?'Sell':'Buy' for the legs? Also - I am not sure how you decided on your limit and stop prices both in main and in legs. That doesn't look like it works both for sells (if mouse is on left side of DOM) and buys (if mouse is on right). Are you sure about those?
  4. You can definitely just have a separate connection - the internal server can handle thousands of connections.
  5. Jason, MT's Websocket API is mostly asynchronous. That means that you send a command and don't wait for immediate response to the command. The response will just come when it comes (usually pretty fast but still). You can match the command to the response by sending a unique reqID in the command and matching it to the reqID in the response. The part that processes responses and decides where to direct it does not really has to be multithreaded - it should be very fast. But once you receive and parse the response you can direct it to a separate thread or queue if you like. Although I would wonder if that's overkill. Usually such processing is fast enough and the events that happen are (comparatively) rare enough (that is, not 100s a second) that multithreading may not be needed.
  6. 2023-06-23T13:30:00.000 - that's UTC time. Currently 4 hours difference from Eastern. So that would be 9:30 Eastern.
  7. Mike Medved

    Saved order

    No - it would be copied from the main leg of the order. In fact, most brokers I think don't allow quantities in sub-legs that are different from main.
  8. Mike Medved

    Saved order

    Actually, Niko, I should amend my previous answer. This waiting for an order to execute cannot be done on MT side. But it can be done on the broker side, if your broker supports it. So if your broker supports OTOCA orders, here is a hotkey
  9. Mike Medved

    Saved order

    The limiting thing here is, the hotkey just executes, section by section. It cannot wait for one order to complete before continuing. There is no mechanism to do that.
  10. will be done in next beta.
  11. Mike Medved

    Saved order

    If instead of "Buy limit x% of account" you'd accept "Buy market x% of account" and then assume that it was bought at current Ask (for the "entry" part of the subsequent orders) - yes you can. Or - if you split it in two. One hotkey would do the "Buy limit x% of account". And the other (that you would execute once you see the buy go through) would set up the other two OCO orders.
  12. Mike Medved

    Saved order

    You cannot do that for several reasons. 1. Limit order is definitely not guaranteed to fill in 5 seconds (which is the delay you set)... and 2. Even if it did, the variables that are used in the hotkey are set at the beginning of the whole hotkey, and are not recalculated at the beginning of each section. So if you have no position at the start of the hotkey, the PosAbs will be 0 even if the first section executes an order and a position appears. What you would have to do is calculate the quantity and make it a variable in the variable section at the very start of the hotkey. Then use that variable in the subsequent sections. Same for the Paid price. And still have to take the (1) fact above into account.
  13. ok I see why. If you click on that checkbox twice (remove it then re-add it) in that row, it will correct. The switching from buy/sell and call/put was screwed up. Will fix.
  14. Click on Drag-Scroll in the Draw selection in the chart.
  15. Hans, place a "Paintbar" indicator on the chart. Select the paintbar you created inside that indicator. There are also options on how to apply the paintbar, visually, to the chart. For your purpose, select the "Color Candles" method.
  16. What color would you want a doji candle to be? Let's say you want it always to be the positive color. Then you configure a paintbar that says "If Close>=Open then Positive Color else Negative Color." Put that on the chart, then make it color candles.
  17. Yeah, that would be a separate option in Compare Symbol. Will see about it.
  18. Shift - toggles between trace and no trace. Ctrl-Shift - toggles between freestyle trace and snap-to-candles.
  19. Yes. Hotkey has a PriceAtMouse variable you can use.
  20. Well. The options in the Compare Symbol is - Anchor and Fit - which shows the % Fit Scale to Overlap - which shows the Compare symbol fitted into the chart, with the Min/Max fitting. Share Scale no Fit - which makes the scale big enough to fit both.
  21. In Alert Editor - add a Trade Fill Alert and only pick Sound as a Notification.
  22. The formula for EMA is simple: 1. Mult = 2/(1+period) 2. EMA = PrevEMA+Mult*(Value-PrevEMA) So - take a set of data. Let's say 1000 points. And do EMA using the last 20, then last 40, then last 60 etc. And compare the values You can even do that in excel...
  23. If you wanted to go back a long way on a scan, you can use the SetDaysNeeded function. We try not to overdo that so that the initial backfills on scans don't take a really long time.
  24. Are you asking about charts? It goes back to the beginning of the chart. Are you asking about paintbars? For intraday, usually to the beginning of the day, unless some indicator in the paintbar requires more or you specify more by calling the SetDaysNeeded function.
  25. Someone asked for this, it is now implemented, will be in next beta. Now when you set up Trade Beads in the chart, you will be able to access its value inside a Paintbar (note - not a Scan, a Paintbar) by using the TradeBead(int BeadNum) function.
×
×
  • Create New...