Hoping to get some direction from someone in the forum.
Originally I started down the path of creating a strategy that would use the OCO concept by having a long and a short both created in a strategy and when one order was triggered the other would be cancelled. I researched the Ninja forum and discovered that one cannot place a short and a long from the same strategy ( this is also confirm by Josh in one of his replies). However, some managed to get both orders into the dom by using 2 strategies, one for the long and another for the short. Bertrand mentioned that one could use global variables to acomplish the equivalent of an OCO and once the order is triggered on one side an update to the global variable could be made and the other strategy could just cancel the other side of the order. The use of global variables is not support in the forum and no direction is provided.
There is an easy way to do this, maybe not the cleanest/faster way, but easy: let your variable be a file.
In the Long strategy, if the order is triggered, and their is no "short.txt" file, create a file "long.txt".
In the Short strategy, check if a file named long.txt exists, and don't take the trade if yes.
Much easier to do than writing a .dll which manage a GV.
Usually in trading, those who know don't talk, and those who talk don't know. (Al Brooks)
success requires no deodorant! (Sun Tzu)
The following user says Thank You to sam028 for this post: