Hi All, Have searched toe forums far and wide but unable to find the logic/method i require.
I have a basic ADL skill set at the moment and am self learning.
I have created a basic algo that if the Bid/Ask spread is greater than 1, i will offer the choice price if the offer is larger than the bid and vice versa for bids. If Equal nothing happens.
Once/if filled, the algo then works a tick or scratch if market moves.
I am wondering how to get the algo to repeat this process automatically for an indefinite amount of time once the sequence is completed. Currently i have to cancel the algo and restart it.
Have looked into loop blocks but cannot seem to understand the logic, have looked into reloads but not quite what i require.
I just want the algo to restart the entire process.
Answer by russelltromans-1 · Nov 25, 2020 at 11:23 AM
There are a number of ways in which you could approach this, below I will detail the most straight forward method of increasing the input quantity to initiate a new order.
To repeat or reload an Order Block you will need to increase it's input quantity to a number greater than the number of fills already achieved by that block. This is due to the 'block memory', each block calculates it's working quantity using the following equation, Input Qty - Fill Qty = Working Qty.
Below I have created a simplified example of this process that could be integrated into your existing logic.
Thanks for the very quick response. However there seems to be some formula issues with this logic. I have the EXACT same layout and blocks as you however am told by ADL that i must have a valid formula for the ValEx and the ValAccum's...
Not entirely sure why this is as my logic is the same as your example here
Sorry, i am such a novice. i have created the formula in the Val blocks. I didnt know I had to do that. They are created and now my ADL keeps crashing... LOL. Will try again in the morning. Thank you so much for your help with the loop. Its been bugging me for the past week!!!
Answer by anonymouswhistleblower08 · Nov 26, 2020 at 07:00 AM
Hi, have been playing around with the algo logic you shared and while i think i have the main parts of it drilled into my head, theres one issue i have now.
The ValAccum block, how am i formulating that in order to specify the fill quantity for the order to close the trade off? Im left hung in a simulated environment when using that block and not sure what formula i need to add in order to tell the order to close the trade the quantity of the initial fill...
Both of the Value Accumulators use a value of '#fillQuantity' and the Value Extractor references the exit fill accumulator block with a formula of '@Exit Fill Qty' although this will be relative to the name you give the block.
Answer by rolando · Dec 29, 2020 at 06:09 AM
The cleanest way to do what you want is to use virtualized blocks. Virtualized block is simply a block that is created everytime a discrete message is created. I created an example for you below:
Overview:
Answer by rolando · Dec 29, 2020 at 06:10 AM
Inside the exit strategy block is below:
If you need the json file you can email me to get it as this board won't allow me to upload the .json file from what I can tell. my email is rolando@adlprogrammer.com
@anonymouswhistleblower08
Ask questions and share ideas about the TT® and X_TRADER® platforms.
First time here? See our Getting Started Guide and FAQs.
© 2017 Trading Technologies International, Inc. All rights reserved.
Powered by AnswerHub