Jump to content
Medved Trader Forums

Mike Medved

Administrators
  • Posts

    1,537
  • Joined

  • Last visited

  • Days Won

    123

Everything posted by Mike Medved

  1. Hm - it is an HTTP request. It has to receive something back... Does it expect JSON back?
  2. What error are you getting?
  3. You set Trading_AccountNumber to the account ID of the trading account defined in MT. Then all the Trading_* variables populate.
  4. Well, for time-based charts you can see how many minutes have passed since the beginning of the session.... TradingDay.SessionStart
  5. You can, in paintbar code, get the previous close and today's open point and draw a line (with the SetLine function). And, if you mean fibonacci retracements, you could draw some based on those two points with additional SetLine functions, yes.
  6. We stream ticks that come in. We don't stream the candles, but we do build the candles for the getCandles command.
  7. In general, looping in scans/paintbars is not an efficient method... You have to remember, the code in scan/paintbar is executed for each candle to start with, and then for each update subsequently. The paintbar is a state machine. So all the stuff that you do with loops can be done by, for example for your loops, keeping a counter that is increased each time the condition is met, zeroing it each time the position is not met. Have to do that with "State-keeping" code, with the counter inside the state.
  8. 1. No, intervars don't stream. You have to get it every time you want an updated value. It is very light in terms of processing, so poll it as much as you want. Make sure you figure out what intervar you want - a symbol-specific one or a "global" one. 2. No need to throttle scans. You run the scan, it initializes (possibly slowly if there are a lot of backfills) then just runs on every update. Again, unless it is written really inefficiently (like huge loops for each run) it is pretty light, so no need to just run it every X minutes. But - if you really would like to, there is code that you can put in the scan that will only run once the candle is finished. Just check the IsNewCandle variable, and if true, run the calculations on the previous candle (which at that point would be finished).
  9. Ok. Can you give me a list of variables that you need accessible. And it would be per account per symbol, right?
  10. The hotkey actually places the order. If it is a "send" it sends the order to the broker. If it is not a "send" but just a "drop" it drops the capsule on the chart. But it is a "do and forget" thing. If you send or drop another order, it will not replace the previous one, it will add one more... There is a ChangeOrder hotkey that could work, but you would still to hit the hotkey to do that and it works under certain circumstances only. Like on Chart it would change the order over which the mouse is, or if there is only one order, will change that one.
  11. You're doing this in a scan, you have the SymbolData.Symbol string variable available. Just check for SymbolData.Symbol.StartsWith(".SPY") or something. Like, if you don't want your scan to run on ANY option symbol, just put this at the very start of the scan .fctbNone{ color:#000000; } .fctbStyle5{ color:#0000ff; } .fctbStyle6{ color:#800000; } if (SymbolData.Symbol.StartsWith(".SPY")) return;
  12. The "Possible security violation" is there for a reason. We don't want paintbars/scans to write to files. Basically because if someone gave you a scan and you ran it and you didn't go through the code with a comb, it could do malicious stuff to your computer...
  13. Mike Medved

    Raw Data

    Means the data you see comes from an OHLC backfill (not from a running feed or from a tick backfill). OHLC backfill in MT means - MT received one minute OHLC data and split it into 4 pseudo-ticks, - O H L and C spread across that minute's time period.
  14. You can execute two or more orders in one hotkey... Each one independent of the other?
  15. I have a full plate in front of me right now. Please drop me an email in a week or so pointing to this thread to remind me of it.
  16. First, you have an OTA order with 2 different quantities in the legs. I am pretty sure we don't allow for it. Second - your "triggered" order has Pos as the quantity. You probably think that the Pos includes the amount that was bought on the first leg. But the Pos is taken from the account positions *at the time* of the hotkey execution.
  17. Well. As long as it's consistent, it's good for your purposes...
  18. #include just physically places that block of text from that file into the paintbar. Frequency - that's the CandleSizeInSec variable. Use that for the "freq".
  19. Basically, any snippet of the C# code that would work in advanced paintbar could be isolated into a separate file and included via the #include. The #include is there so that you can have a library of functions you use and #include it in paintbars without repeatedly inserting the same code in every paintbar where it would be used.
  20. I fixed this - the fix will be in next release. Basically the backfillAndGetCandles's "full" method was not being passed on.
  21. well.. you have Qty as 30/(Ask-PriceAtMouse). Should really be floor(30/(Ask-PriceAtMouse)) - because quantity is an integer. So then the total amount of the transaction would be (since it is a Market Buy, let's assume it is at Ask) Ask * floor(30/(Ask-PriceAtMouse)) You don't want that to be more than $10k, so that amount would be Min(10000, Ask * floor(30/(Ask-PriceAtMouse))) Thus the appropriate quantity should be that amount divided by Ask (and floor taken for it so that it is integer) floor(Min(10000, Ask * floor(30/(Ask-PriceAtMouse))) / Ask)
  22. 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.
  23. Paintbars/scans are not tied to any particular account... It's true you could specify the account right in the function call. Would have to think on it.
×
×
  • Create New...