3acor 1 Posted January 7 Report Share Posted January 7 Hey, If Pos<0... it is giving me invalid quantity. What is wrong with the code? Quote Link to post Share on other sites
Kasper 3 Posted January 7 Report Share Posted January 7 For closing order, you don't need two sections for order, unless you are doing something else in second section. Prefer to define one set of variables first then use same in all conditionals. For closing short position, use abs(pos) for quantity in condition if Pos<0. Quote Link to post Share on other sites
Mike Medved 100 Posted January 8 Report Share Posted January 8 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? Quote Link to post Share on other sites
3acor 1 Posted January 8 Author Report Share Posted January 8 4 hours ago, Kasper said: For closing order, you don't need two sections for order, unless you are doing something else in second section. Prefer to define one set of variables first then use same in all conditionals. For closing short position, use abs(pos) for quantity in condition if Pos<0. ok thanks a lot.. will do that Quote Link to post Share on other sites
3acor 1 Posted January 8 Author Report Share Posted January 8 1 hour ago, Mike Medved said: 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? I am not sure honestly, I think it did it on its own. I sent it. Quote Link to post Share on other sites
Mike Medved 100 Posted January 8 Report Share Posted January 8 8 minutes ago, 3acor said: I am not sure honestly, I think it did it on its own. I sent it. 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 Quote Link to post Share on other sites
3acor 1 Posted January 8 Author Report Share Posted January 8 1 minute ago, Mike Medved said: 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 yea I was surprised too... hehe ok Quote Link to post Share on other sites
Arg 0 Posted January 8 Report Share Posted January 8 3acor, When (if) you get your sell hotkey working can you do me a solid and post a snapshot of the entire text here? I have been trying for several days to get this working but haven't figured out how so far. Thanks Quote Link to post Share on other sites
Mike Medved 100 Posted January 8 Report Share Posted January 8 If you tell me what you'd like to do, I will make one and post it. Quote Link to post Share on other sites
Arg 0 Posted January 8 Report Share Posted January 8 Mike, can you just take 3acor's hotkey (for a close of an existing long position or a short position). Sell on bid or ask (I can change this later) All values can be default (but leave in the variables in case I want to change) Thanks Quote Link to post Share on other sites
3acor 1 Posted January 8 Author Report Share Posted January 8 2 hours ago, Arg said: 3acor, When (if) you get your sell hotkey working can you do me a solid and post a snapshot of the entire text here? I have been trying for several days to get this working but haven't figured out how so far. Thanks Yes sure, I will try to do it later on during the day. Quote Link to post Share on other sites
Mike Medved 100 Posted January 8 Report Share Posted January 8 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. Quote Link to post Share on other sites
Mike Medved 100 Posted January 8 Report Share Posted January 8 Quote Link to post Share on other sites
3acor 1 Posted January 8 Author Report Share Posted January 8 (edited) 2 minutes ago, Mike Medved said: Thanks a lot Mike. Appreciate it 1 hour ago, Mike Medved said: 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. that's good . What was it ? I am curious Edited January 8 by 3acor Quote Link to post Share on other sites
Mike Medved 100 Posted January 8 Report Share Posted January 8 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? Quote Link to post Share on other sites
3acor 1 Posted January 8 Author Report Share Posted January 8 Just now, Mike Medved said: To follow up - is my writeup in the help up too terse or insufficient? Would adding examples like the above help? If so, what examples? It's pretty good to me. That's as far as complex as I use. Thanks Quote Link to post Share on other sites
Arg 0 Posted January 8 Report Share Posted January 8 I suggest giving more examples (complete examples with all typical values/variables filled in) in the help. eg buy / sell / buy with stop / bracket order with 1 profit target / bracket with 2 profit targets. This would make life easier for many people I think. Quote Link to post Share on other sites
Mike Medved 100 Posted January 9 Report Share Posted January 9 9 hours ago, 3acor said: Thanks a lot Mike. Appreciate it that's good . What was it ? I am curious 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. Quote Link to post Share on other sites
3acor 1 Posted January 9 Author Report Share Posted January 9 11 hours ago, Mike Medved said: 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. hehe... We all make mistakes, no one is perfect. Ok I see it now, was just wondering as I sure didn't plan it Quote Link to post Share on other sites
Arg 0 Posted February 19 Report Share Posted February 19 Mike, Could you modify the sell hotkey (the one you did above and also attached here) to include 2 additional cases: 1) sell half of the current position 2) sell the number of shares highlighted in the quantity tabs in the Level 2 window (the row of small tabs along the top). This will be useful as I can scale in to a position by pressing the buy key multiple times and then scale out in stages by pressing the sell key. Quote Link to post Share on other sites
Mike Medved 100 Posted February 20 Report Share Posted February 20 Ok sell half of current position is easy - Pos / 2 The other - the DefaultQty should work Quote Link to post Share on other sites
Arg 0 Posted Monday at 12:11 PM Report Share Posted Monday at 12:11 PM Hi, If I click on 10 shares in the quantity icon, and then buy 2 lots, I will have 20 shares. If I then use the hotkey below, which uses the default quantity, then it will sell the entire position of 20 shares. Before pressing this key the highlighted quantity is 10 shares, after pressing it has changed to 20 shares. How can I change the hotkey so that the sell quantity is the original buy quantity (i.e. the highlighted value) and not the total quantiy? Quote Link to post Share on other sites
Arg 0 Posted Monday at 07:00 PM Report Share Posted Monday at 07:00 PM Ok, I found the problem. I hadn't changed the action section at the bottom. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.