def close_all(): # print ("--- Fonction CloseAll ---") for deal_id_to_delete, v in globalvar.dict_open_position.items(): direction = v.get('direction') size = v.get('size') # Appel du events-> delete events.delete(deal_id_to_delete, direction, size)
def CloseAllepicButton(event): #print ("--- Fonction Close All epic ---") for dealId_todelete, v in globalvar.dict_openposition.items(): if v.get('epic') == personal.epic: direction = v.get('direction') size = v.get('size') events.delete(dealId_todelete, direction, size) #Appel du events-> delete
def OnKeyPress(event): #print(" Fonction Main OnKeyPress ") code = event.GetKeyCode() if (globalvar.isKeyBoardTrading) : #if code == wx.WXK_UP: #print("Up") #events.get_openPositions() if code == wx.WXK_CONTROL: print("Ctrl/Cmd") last_pos_id = globalvar.dict_openposition.keys()[-1] direction = globalvar.dict_openposition.get(last_pos_id).get('direction') size = globalvar.dict_openposition.get(last_pos_id).get('size') events.delete(last_pos_id, direction, size) #Appel du events-> delete if code == wx.WXK_LEFT: print("Left") order(event, "SELL", globalvar.requestDealSize, globalvar.isForceOpen, globalvar.SLpoint, globalvar.TPpoint, globalvar.isStopGuaranteed) if code == wx.WXK_RIGHT: print("Right") order(event, "BUY", globalvar.requestDealSize, globalvar.isForceOpen, globalvar.SLpoint, globalvar.TPpoint, globalvar.isStopGuaranteed) if code == wx.WXK_DOWN: print("Down") CloseAll() #Appel de la fonction pour fermer tous les ordres ouverts avec une copie du dictionnaire """ if code == wx.WXK_ESCAPE: print("Escape") if code == wx.WXK_RETURN: print("Return") """ event.Skip()
def close_all_epic_button(event): # print ("--- Fonction Close All epic ---") for deal_id_to_delete, v in globalvar.dict_open_position.items(): if v.get('epic') == personal.epic: direction = v.get('direction') size = v.get('size') # Appel du events-> delete events.delete(deal_id_to_delete, direction, size)
def OnClick_openpositionslist(self, event): #print("--- fonction OnClick_openpositionslist ---") dealId_todelete = str(self.openpositions_list.GetItemText(self.openpositions_list.GetFirstSelected())) direction = globalvar.dict_openposition.get(dealId_todelete).get('direction') size = globalvar.dict_openposition.get(dealId_todelete).get('size') #print ("DealId a supprimer ", dealId_todelete, direction , size) events.delete(dealId_todelete, direction, size) #Appel du events-> delete
def OnClick_openpositionslist(self, event): # print("--- fonction OnClick_openpositionslist ---") id_deal_to_delete = str( self.open_positions_list.GetItemText( self.open_positions_list.GetFirstSelected())) deal_to_delete = globalvar.dict_open_position.get(id_deal_to_delete) direction = deal_to_delete.get('direction') size = globalvar.dict_open_position.get(id_deal_to_delete).get('size') # print ("DealId a supprimer ", id_deal_to_delete, direction , size) # Appel du events-> delete events.delete(id_deal_to_delete, direction, size)
def on_key_press(event): # print(" Fonction Main OnKeyPress ") code = event.GetKeyCode() if globalvar.is_keyboard_trading: # if code == wx.WXK_UP: # print("Up") # events.get_openPositions() if code == wx.WXK_CONTROL: print("Ctrl/Cmd") last_pos_id = globalvar.dict_open_position.keys()[-1] last_pos = globalvar.dict_open_position.get(last_pos_id) direction = last_pos.get('direction') size = globalvar.dict_open_position.get(last_pos_id).get('size') # Appel du events-> delete events.delete(last_pos_id, direction, size) if code == wx.WXK_LEFT: print("Left") order(event, "SELL", globalvar.request_deal_size, globalvar.is_force_open, globalvar.sl_point, globalvar.tp_point, globalvar.is_guaranteed_stop_trading) if code == wx.WXK_RIGHT: print("Right") order(event, "BUY", globalvar.request_deal_size, globalvar.is_force_open, globalvar.sl_point, globalvar.tp_point, globalvar.is_guaranteed_stop_trading) if code == wx.WXK_DOWN: print("Down") # Appel de la fonction pour fermer tous les ordres ouverts # avec une copie du dictionnaire close_all() """ if code == wx.WXK_ESCAPE: print("Escape") if code == wx.WXK_RETURN: print("Return") """ event.Skip()