Jump to content
Medved Trader Forums

Arg

Members
  • Posts

    172
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Arg

  1. Hi,

    I have a simple script that I used elsewhere to find a spike in price/volume. I would like to use it here but need some assistance.

    There are two parts, first one for a spike in price, second part for a spike in volume. Both are identical in form.

    The final condition for the scan is to have true results for both the price and volume condition.

    The pseudocode is below. The ''def'' keyword is used to define a variable or a constant, and also a condition.

    c is the current price of the stock (not a 'closed' price - despite the name). c[1] is the closing value (price) of the last completed bar. c[2] is the closing value of the bar before c[1]. Same thing with volume v, v[1], v[2], v[3] etc.

    The stdev(closeLog, 11) calculates the standard deviation of 11 values of closeLog. So (if my understanding is correct) first value will be log(c[1] / c[2]), second value will be log(c[2] / c[3]), etc up to the final 11th value, which will be log(c[11] / c[12]).

    Any suggestions or help converting to a format suitable  for the advanced scanner would be appreciated.

    ----------------------------------------------------------

    def length = 11;
    def c = close;
    def closeLog = log(c[1] / c[2]);
    def SDevClose = stdev(closeLog, length) * sqrt(length / (length-1));
    def m = SDevClose * c[1];
    def pricespike = (c - c[1]) / m > 3;


    def v = volume;
    def volumeLog = log(v[1] / v[2]);
    def SDevVol = stdev(volumeLog, length) * sqrt(length / (length-1));
    def n = SDevVol * v[1];
    def volumespike = (v - v[1]) / n > 3;


    scan = pricespike and volumespike;

    -------------------------------------------------------------

     

  2. 12 minutes ago, Jerry Medved said:

    by default MT is set to bring up transactions window when an order is placed. I am sure that is what is causing the focus issue for you. 

    Go to SETTINGS / TRADING / GENERAL - UN-Check the box for "Show Account View / Transactions after submitting new order". That will fix your issue.

    Yes, that was it. The Account window was appearing on another monitor so I hadn't noticed it.

    Thanks

  3. Just now, Mike Medved said:

    Well yeah - when you click on a control on a window, it becomes active... Hotkeys are executed on the active window.

    But - your hotkey can be executed on tradeticket as well, no?

     

    Yes, the hotkey can be executed on tradeticket. But why does the tradeticket window become deactivated? I press the buy button on the tradeticket window - and don't click anywhere else, so I would expect the tradeticket window to still be active. Something seems to be deactivating it.

  4. 11 hours ago, Jerry Medved said:

    found the issue. had to do with the 2 open orders being child orders in OTOCA. the process that handled the cancel first, did not see the "Child" orders so it thought all orders were canceled. 

    Fixed, emailed you an update.

    Thanks - working ok now.

    • Like 1
  5. I bought using the trade ticket buy button.  The order is filled and I can see the change in gain on the chart. If I then press my sell hotkey nothing happens. If I mouse click on the trade ticket window then the hotkey will work. It seems as if the window becomes deactivated after clicking the buy button. Is there a way around this?

  6. 35 minutes ago, Jerry Medved said:

    any overbought/oversold message would come from the broker, not us.

    What broker is this with?

    when you say "completed order" you mean filled, or the order went through but not executed yet?

    and I can't tell you why it failed first time without seeing log. Please send

    Go to FILE / HELP => Send Log/Settings to support menu (from Dashboard or Portfolio)

    And add this Post’s URL in the comment. 

     

    Log file sent. The broker is TDA. The completed order was filled - I could see the capsule with the changing gain value.

    Thanks

  7. I have a problem with the hotkey  pasted below.

    I buy 50 shares using the trade ticket - bracket order. The completed order appears on the charts. Then I click on the tick chart and press the sell hotkey below. The quantity in the tick chart is 100 shares. I get a message saying that my position will be oversold/bought. No sell is made. I then press the same hotkey again and it sells 50 shares.

    What is going on here? Where is there an overbought/oversold message? And why does the hotkey work on the second click?

     

     

    image.png.3df1f72bcbb88704b528257acb353825.png

  8. 11 hours ago, Jerry Medved said:

    Hold down the shift key. If you want to change the default, you can do that on settings / charts / general

    If I hold down shift then the cross-hairs disappear completely.  What would be nice would be to toggle easily between "Freestyle" and "Snap to Candles" modes.

×
×
  • Create New...